66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
export const dynamic = "force-dynamic";
|
||
|
||
import type { Metadata } from "next";
|
||
import Link from "next/link";
|
||
import { PageHeader } from "@/components/page-header";
|
||
import { ogForTranscriptions } from "@/lib/og";
|
||
import {
|
||
getTranscriptionYears,
|
||
getTranscriptionPlaces,
|
||
getTotalTranscriptionCount,
|
||
getTranscriptionIndex,
|
||
} from "@/lib/transcriptions";
|
||
import { TranscriptionsNav } from "./transcriptions-nav";
|
||
import { TranscriptionsBrowser } from "./transcriptions-browser";
|
||
|
||
export function generateMetadata(): Metadata {
|
||
return ogForTranscriptions();
|
||
}
|
||
|
||
export default async function TranscriptionsPage({
|
||
searchParams,
|
||
}: {
|
||
searchParams: Promise<{ view?: string }>;
|
||
}) {
|
||
const { view = "year" } = await searchParams;
|
||
|
||
const [years, places, totalCount, index] = await Promise.all([
|
||
getTranscriptionYears(),
|
||
getTranscriptionPlaces(),
|
||
getTotalTranscriptionCount(),
|
||
getTranscriptionIndex(),
|
||
]);
|
||
|
||
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">
|
||
Transcriptions
|
||
</h1>
|
||
<p className="mt-1 text-muted-foreground">
|
||
{totalCount.toLocaleString()} lectures & conversations of Śrīla
|
||
Prabhupāda (1966–1977)
|
||
</p>
|
||
</PageHeader>
|
||
|
||
<main className="max-w-4xl mx-auto px-6 py-8 space-y-6">
|
||
<TranscriptionsNav currentView={view} />
|
||
|
||
<TranscriptionsBrowser
|
||
currentView={view}
|
||
years={years}
|
||
places={places}
|
||
lectureCount={index.typeDistribution.lecture}
|
||
conversationCount={index.typeDistribution.conversation}
|
||
/>
|
||
</main>
|
||
</div>
|
||
);
|
||
}
|