feat: kb both volumes

This commit is contained in:
gosangam
2026-04-16 00:48:48 +05:30
parent abb7cc49d0
commit d88ababd76
15 changed files with 2298 additions and 40 deletions
+23 -5
View File
@@ -21,6 +21,12 @@ interface ChapterBookMeta extends BookMeta {
chapters: ChapterEntry[];
}
interface KbMeta extends BookMeta {
totalChapters: number;
description: string;
volumes: { number: number; totalChapters: number }[];
}
interface SbMeta extends BookMeta {
totalCantos: number;
cantos: CantoEntry[];
@@ -112,6 +118,16 @@ function buildBookList(allBooks: BookMeta[]): BookInfo[] {
totalVerses,
href: "/books/cc",
});
} else if (slug === "kb") {
const kb = data as KbMeta;
books.push({
slug,
title,
author,
description: `${kb.totalChapters} chapters · 2 volumes`,
totalVerses: 0,
href: "/books/kb",
});
}
}
@@ -156,11 +172,13 @@ export default async function BooksPage() {
<CardContent>
<div className="flex items-center gap-3 text-sm">
<Badge variant="secondary">{book.description}</Badge>
<ExtractedVerseCount
count={book.totalVerses}
label="extracted verses"
className="text-muted-foreground"
/>
{book.totalVerses > 0 && (
<ExtractedVerseCount
count={book.totalVerses}
label="extracted verses"
className="text-muted-foreground"
/>
)}
</div>
</CardContent>
</Card>