import { redirect } from "next/navigation"; import { notFound } from "next/navigation"; import { getChapterVerseIndex } from "@/lib/api"; export default async function SbChapterPage({ params, }: { params: Promise<{ canto: string; chapter: string }>; }) { const { canto, chapter } = await params; const verseIndex = await getChapterVerseIndex("sb", canto, parseInt(chapter)); if (verseIndex.length === 0) { notFound(); } redirect(`/books/sb/${canto}/${chapter}/${verseIndex[0].verse}`); }