feat: add policy pages

This commit is contained in:
gosangam
2026-06-02 01:57:08 +05:30
parent 0352cb2003
commit 91d5d272d2
168 changed files with 1326 additions and 81 deletions
+37
View File
@@ -0,0 +1,37 @@
import type { Metadata } from "next";
import { redirect } from "next/navigation";
import { notFound } from "next/navigation";
import { getChapterVerseIndex } from "@/lib/api";
import { buildOgMeta } from "@/lib/og";
import { BOOK_NAMES } from "@/lib/constants";
export const dynamic = "force-dynamic";
export async function generateMetadata({
params,
}: {
params: Promise<{ chapter: string }>;
}): Promise<Metadata> {
const { chapter } = await params;
return buildOgMeta({
title: BOOK_NAMES["sb1962"],
detail: `Chapter ${chapter}`,
});
}
export default async function ChapterPage({
params,
}: {
params: Promise<{ chapter: string }>;
}) {
const { chapter } = await params;
const verseIndex = await getChapterVerseIndex(
"sb1962",
null,
parseInt(chapter),
);
if (verseIndex.length === 0) {
notFound();
}
redirect(`/books/sb1962/${chapter}/${verseIndex[0].verse}`);
}