import { useLoaderData } from "@remix-run/react"; import { Title } from "~/components/Title"; import { findPosts } from "~/utils/posts.server"; import { EmptyState } from "./EmptyState"; import { PostPreview } from "./PostPreview"; 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) => ( ))}
) : ( )}
); }