import type { EpubTocItem } from "../components/reader/TableOfContents";

export function fallbackPdfPageToc(
  pageCount: number,
  labelForPage: (page: number) => string,
): EpubTocItem[] {
  if (pageCount <= 0) return [];
  return Array.from({ length: pageCount }, (_, i) => ({
    label: labelForPage(i + 1),
    href: `pdf:page:${i + 1}`,
  }));
}
