feat: letters added

This commit is contained in:
gosangam
2026-05-04 00:08:31 +05:30
parent 35d1d14f37
commit 401766928a
20 changed files with 4272 additions and 26 deletions
+55
View File
@@ -0,0 +1,55 @@
export const dynamic = "force-dynamic";
import Link from "next/link";
import { PageHeader } from "@/components/page-header";
import {
getLetterYears,
getLetterRecipients,
getLetterLocations,
getTotalLetterCount,
} from "@/lib/letters";
import { LettersNav } from "./letters-nav";
import { LettersBrowser } from "./letters-browser";
export default async function LettersPage({
searchParams,
}: {
searchParams: Promise<{ view?: string }>;
}) {
const { view = "year" } = await searchParams;
const [years, recipients, locations, totalCount] = await Promise.all([
getLetterYears(),
getLetterRecipients(),
getLetterLocations(),
getTotalLetterCount(),
]);
return (
<div className="min-h-screen bg-background">
<PageHeader>
<Link
href="/"
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
>
&larr; Home
</Link>
<h1 className="mt-3 text-3xl font-bold text-foreground">Letters</h1>
<p className="mt-1 text-muted-foreground">
{totalCount.toLocaleString()} letters by Śrīla Prabhupāda (1947–1977)
</p>
</PageHeader>
<main className="max-w-4xl mx-auto px-6 py-8 space-y-6">
<LettersNav currentView={view} />
<LettersBrowser
currentView={view}
years={years}
recipients={recipients}
locations={locations}
/>
</main>
</div>
);
}