chore: refactor settings route

This commit is contained in:
gosangam
2026-07-14 18:16:32 +05:30
parent 1683abc2e9
commit 1582df0ed5
134 changed files with 677 additions and 463 deletions
@@ -0,0 +1,68 @@
export const dynamic = "force-dynamic";
import type { Metadata } from "next";
import Link from "next/link";
import { PageHeader } from "@/components/layout/page-header";
import { ogForTranscriptions } from "@/lib/og";
import {
getTranscriptionYears,
getTranscriptionPlaces,
getTranscriptionBooks,
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, books, totalCount, index] = await Promise.all([
getTranscriptionYears(),
getTranscriptionPlaces(),
getTranscriptionBooks(),
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()}&nbsp;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}
books={books}
lectureCount={index.typeDistribution.lecture}
conversationCount={index.typeDistribution.conversation}
/>
</main>
</div>
);
}