import Link from "next/link"; import { FitList } from "./fit-list"; import { Chevron } from "./ui"; export type PostSummary = { id: string; title: string; createdAt: string | null; }; const fmt = (iso: string | null) => iso ? new Date(iso).toLocaleDateString("en-US", { month: "short", year: "numeric", timeZone: "UTC", }) : ""; export function WritingCard({ posts }: { posts: PostSummary[] }) { return (

Writing

All posts
{/* As many posts as the card has room for; the rows that show share out the spare height, so the list always ends at the card's inset. Rows never shrink, so FitList can see which ones overflow. */} {posts.slice(0, 10).map((p) => (
  • {p.title}
  • ))} {posts.length === 0 && (
  • Read the blog →
  • )}
    ); }