export const dynamic = "force-dynamic"; import { notFound } from "next/navigation"; import { getLettersByYear } from "@/lib/letters"; import { YearMonthBrowser } from "./year-month-browser"; export default async function LettersByYearPage({ params, }: { params: Promise<{ year: string }>; }) { const { year: yearStr } = await params; const year = parseInt(yearStr, 10); if (isNaN(year)) notFound(); const letters = await getLettersByYear(year); if (letters.length === 0) notFound(); const serialized = letters.map((l) => ({ slug: l.slug, recipientDisplay: l.recipientDisplay, date: l.date, year: l.year, month: l.month, location: l.location, })); return (
); }