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,46 @@
export const dynamic = "force-dynamic";
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { getTranscriptionsByYear } from "@/lib/transcriptions";
import { buildOgMeta } from "@/lib/og";
import { TranscriptionYearBrowser } from "./year-browser";
export async function generateMetadata({
params,
}: {
params: Promise<{ year: string }>;
}): Promise<Metadata> {
const { year: yearStr } = await params;
const year = parseInt(yearStr, 10);
if (isNaN(year)) return {};
const transcriptions = await getTranscriptionsByYear(year);
return buildOgMeta({
title: "Transcriptions",
detail: `${transcriptions.length} lectures & conversations from ${year}`,
quote: `Lectures and conversations of Śrīla Prabhupāda from ${year} — the living voice of the Founder-Ācārya preserved in text.`,
});
}
export default async function TranscriptionsByYearPage({
params,
}: {
params: Promise<{ year: string }>;
}) {
const { year: yearStr } = await params;
const year = parseInt(yearStr, 10);
if (isNaN(year)) notFound();
const transcriptions = await getTranscriptionsByYear(year);
if (transcriptions.length === 0) notFound();
return (
<div className="min-h-screen bg-background">
<TranscriptionYearBrowser
transcriptions={transcriptions}
year={year}
totalCount={transcriptions.length}
/>
</div>
);
}