export const dynamic = "force-dynamic"; import Link from "next/link"; import { notFound } from "next/navigation"; import { getLettersByLocation } from "@/lib/letters"; import { PageHeader } from "@/components/page-header"; import { Card, CardContent } from "@/components/ui/card"; export default async function LettersByLocationPage({ params, }: { params: Promise<{ name: string }>; }) { const { name: encodedName } = await params; const name = decodeURIComponent(encodedName); const letters = await getLettersByLocation(name); if (letters.length === 0) notFound(); return (
← Letters by Location

Letters from {name}

{letters.length} {letters.length === 1 ? "letter" : "letters"}

    {letters.map((letter) => (
  • To: {letter.recipientDisplay}

    {letter.date || "Undated"}

  • ))}
); }