export const dynamic = "force-dynamic"; import Link from "next/link"; import { notFound } from "next/navigation"; import { getLetter, getAdjacentLetters } from "@/lib/letters"; import { PageHeader } from "@/components/page-header"; import { Card, CardContent } from "@/components/ui/card"; import { buttonVariants } from "@/components/ui/button"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { cn } from "@/lib/utils"; export default async function LetterPage({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; const letter = await getLetter(slug); if (!letter) notFound(); const { prev, next } = await getAdjacentLetters(slug, letter.year); const backHref = letter.year ? `/letters/year/${letter.year}` : "/letters"; const backLabel = letter.year ? `Letters from ${letter.year}` : "Letters"; return (
{letter.date} {letter.location ? ` ยท ${letter.location}` : ""}