Files
spsays-training/lib/hkh.ts
T
2026-05-10 00:35:14 +05:30

46 lines
1.1 KiB
TypeScript

/**
* Data access layer for The Hare Kṛṣṇa Handbook (HKH).
*
* Delegates to the generic book data layer which calls the BFF API.
*/
import {
getBookMeta,
getIntroSegments,
getIntroSegment,
getChapter,
getContent,
getSidebarItems,
type BookMeta,
type IntroSegment,
type Chapter,
type SidebarItem,
} from "@/lib/books";
const CODE = "hkh";
export type HkhMeta = BookMeta;
export type HkhChapterEntry = { number: number; title: string };
export type HkhIntroSegment = IntroSegment;
export type HkhChapter = Chapter;
export type HkhSidebarItem = SidebarItem;
export async function getHkhMeta() {
return getBookMeta(CODE);
}
export async function getHkhIntroSegments() {
return getIntroSegments(CODE);
}
export async function getHkhIntroSegment(slug: string) {
return getIntroSegment(CODE, slug);
}
export async function getHkhChapter(chapterNum: number) {
return getChapter(CODE, String(chapterNum));
}
export async function getHkhContent(slug: string) {
return getContent(CODE, slug);
}
export async function getHkhSidebarItems() {
return getSidebarItems(CODE);
}