import { Link, useLoaderData } from "@remix-run/react"; import { findPosts } from "~/models/posts.server"; import { EmptyState } from "./EmptyState"; import { Post } from "./Post"; export const loader = async () => { return findPosts(); }; export default function () { const posts = useLoaderData(); return (
Home
Here I blog about whatever get my attention
{posts.length > 0 ? (
{posts.map((post, i) => ( ))}
) : ( )}
); }