feat: kb both volumes
This commit is contained in:
+23
-5
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user