Files
spsays-training/app/transcriptions/page.tsx
T

66 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"
>
&larr; Home
</Link>
<h1 className="mt-3 text-3xl font-bold text-foreground">
Transcriptions
</h1>
<p className="mt-1 text-muted-foreground">
{totalCount.toLocaleString()} lectures &amp; 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>
);
}