import { useLoaderData } from "@remix-run/react"; import { EmptyState } from "~/components/EmptyState"; import { PostPreview } from "~/components/PostPreview"; import { Title } from "~/components/Title"; import { findPosts } from "~/utils/posts.server"; export const handle = { to: "/", text: "Home", }; export const loader = () => { return findPosts(); }; export default function () { const posts = useLoaderData(); return ( <> Here I blog about whatever get my attention {posts.length > 0 ? (
{posts.map((post, i) => ( ))}
) : ( )} ); }