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

58 lines
1.3 KiB
TypeScript

/**
* Data access layer for Kṛṣṇa Consciousness: The Matchless Gift (MG).
*
* 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 = "mg";
// Re-export types with book-specific names for backwards compatibility
export type MgMeta = BookMeta;
export type MgChapterEntry = { number: number; title: string };
export type MgIntroSegment = IntroSegment;
export type MgChapter = Chapter;
export type MgSidebarItem = SidebarItem;
export async function getMgMeta(): Promise<MgMeta | null> {
return getBookMeta(CODE);
}
export async function getMgIntroSegments(): Promise<MgIntroSegment[]> {
return getIntroSegments(CODE);
}
export async function getMgIntroSegment(
slug: string,
): Promise<MgIntroSegment | null> {
return getIntroSegment(CODE, slug);
}
export async function getMgChapter(
chapterNum: number,
): Promise<MgChapter | null> {
return getChapter(CODE, String(chapterNum));
}
export async function getMgContent(
slug: string,
): Promise<MgChapter | MgIntroSegment | null> {
return getContent(CODE, slug);
}
export async function getMgSidebarItems(): Promise<MgSidebarItem[]> {
return getSidebarItems(CODE);
}