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