67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
export const dynamic = "force-dynamic";
|
||
|
||
import type { Metadata } from "next";
|
||
import Link from "next/link";
|
||
import { PageHeader } from "@/components/layout/page-header";
|
||
import { buildOgMeta } from "@/lib/og";
|
||
import {
|
||
getLetterYears,
|
||
getLetterRecipients,
|
||
getLetterLocations,
|
||
getTotalLetterCount,
|
||
} from "@/lib/letters";
|
||
import { LettersNav } from "./letters-nav";
|
||
import { LettersBrowser } from "./letters-browser";
|
||
|
||
export function generateMetadata(): Metadata {
|
||
return buildOgMeta({
|
||
title: "Letters",
|
||
detail: "6,800+ letters (1947–1977)",
|
||
quote:
|
||
"Personal correspondence by Śrīla Prabhupāda — guiding disciples, Godbrothers, and well-wishers in the science of Kṛṣṇa consciousness.",
|
||
});
|
||
}
|
||
|
||
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"
|
||
>
|
||
← 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>
|
||
);
|
||
}
|