mongo fix

This commit is contained in:
gosangam
2026-04-14 19:12:11 +05:30
parent e2f8063d90
commit beffb9fae1
172 changed files with 18029 additions and 1298 deletions
+5 -17
View File
@@ -1,10 +1,9 @@
import fs from "fs";
import path from "path";
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;
@@ -20,28 +19,17 @@ type LilaInfo = {
chapters: ChapterInfo[];
};
type Intro = {
book: string;
title: string;
author: string;
totalLilas: number;
lilas: LilaInfo[];
};
function getIntro(): Intro {
const introPath = path.join(process.cwd(), "app/lib/books/cc/intro.json");
return JSON.parse(fs.readFileSync(introPath, "utf-8"));
}
export default async function LilaPage({
params,
}: {
params: Promise<{ lila: string }>;
}) {
const { lila } = await params;
const intro = getIntro();
const meta = await getBookMeta("cc");
if (!meta) notFound();
const lilaInfo = intro.lilas.find((l) => l.key === lila);
const lilas = meta.lilas as LilaInfo[];
const lilaInfo = lilas.find((l) => l.key === lila);
if (!lilaInfo) notFound();
const totalVerses = lilaInfo.chapters.reduce(