| --- | |
| import type { MarkdownHeading } from 'astro' | |
| import { generateToc, type TocEntry } from '@libs/toc' | |
| import SharedTableOfContents from '@twbs/bui/components/TableOfContents' | |
| interface Props { | |
| headings?: MarkdownHeading[] | |
| entries?: TocEntry[] | |
| } | |
| const { entries, headings } = Astro.props | |
| const toc = entries ? entries : generateToc(headings ?? []) | |
| --- | |
| <SharedTableOfContents entries={toc as TocEntry[]} /> |