Files
2026-05-10 00:35:14 +05:30

58 lines
1.4 KiB
TypeScript

/**
* Data access layer for On Chanting Hare Kṛṣṇa (OCHKM).
*
* 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 = "ochkm";
// Re-export types with book-specific names for backwards compatibility
export type OchkmMeta = BookMeta;
export type OchkmChapterEntry = { number: number; title: string };
export type OchkmIntroSegment = IntroSegment;
export type OchkmChapter = Chapter;
export type OchkmSidebarItem = SidebarItem;
export async function getOchkmMeta(): Promise<OchkmMeta | null> {
return getBookMeta(CODE);
}
export async function getOchkmIntroSegments(): Promise<OchkmIntroSegment[]> {
return getIntroSegments(CODE);
}
export async function getOchkmIntroSegment(
slug: string,
): Promise<OchkmIntroSegment | null> {
return getIntroSegment(CODE, slug);
}
export async function getOchkmChapter(
chapterNum: number,
): Promise<OchkmChapter | null> {
return getChapter(CODE, String(chapterNum));
}
export async function getOchkmContent(
slug: string,
): Promise<OchkmChapter | OchkmIntroSegment | null> {
return getContent(CODE, slug);
}
export async function getOchkmSidebarItems(): Promise<OchkmSidebarItem[]> {
return getSidebarItems(CODE);
}