feat: add mobile sidebar

This commit is contained in:
gosangam
2026-04-17 23:20:59 +05:30
parent 0aab1d23ec
commit 9b5823146f
30 changed files with 2502 additions and 414 deletions
@@ -3,6 +3,7 @@ import { PageHeader } from "@/components/page-header";
import { notFound } from "next/navigation";
import { getBookMeta, getSingleVerse, getChapterVerseIndex } from "@/lib/api";
import { ChapterViewer } from "@/app/books/chapter-viewer";
import type { MobileNavGroup } from "@/components/mobile-nav";
type ChapterInfo = {
number: number;
@@ -49,6 +50,23 @@ export default async function CcVersePage({
);
if (!verseData) notFound();
// Build mobile nav groups from verse index
const mobileNavGroups: MobileNavGroup[] = [];
if (verseIndex.length > 0) {
mobileNavGroups.push({
title: "Verses",
items: verseIndex.map((v) => {
const label = v.verseEnd ? `${v.reference}` : v.reference;
return {
slug: String(v.verse),
label,
href: `/books/cc/${lila}/${chapter}/${v.verse}`,
type: "verse",
};
}),
});
}
return (
<div className="min-h-screen bg-background">
<PageHeader sticky wide>
@@ -77,6 +95,8 @@ export default async function CcVersePage({
chapter={parseInt(chapter)}
showBengali={true}
basePath={`/books/cc/${lila}/${chapter}`}
mobileNavGroups={mobileNavGroups}
mobileNavBookTitle={`${lilaInfo.name} — Chapter ${chapter}`}
/>
</div>
</div>