-
{lilaInfo.chapters.map((ch) => (
-
Chapter {ch.number}
{ch.title}
))}
import Link from "next/link"; import { PageHeader } from "@/components/page-header"; import { notFound } from "next/navigation"; import { Card, CardContent } from "@/components/ui/card"; import { ExtractedVerseCount } from "../../extracted-verse-count"; import { getBookMeta } from "@/lib/api"; type ChapterInfo = { number: number; title: string; totalVerses: number; }; type LilaInfo = { key: string; name: string; totalChapters: number; totalVerses: number; chapters: ChapterInfo[]; }; export default async function LilaPage({ params, }: { params: Promise<{ lila: string }>; }) { const { lila } = await params; const meta = await getBookMeta("cc"); if (!meta) notFound(); const lilas = meta.lilas as LilaInfo[]; const lilaInfo = lilas.find((l) => l.key === lila); if (!lilaInfo) notFound(); const totalVerses = lilaInfo.chapters.reduce( (sum, ch) => sum + ch.totalVerses, 0, ); return (
{lilaInfo.totalChapters} chapters ·{" "}
{ch.title}