24 lines
556 B
Text
24 lines
556 B
Text
---
|
|
import TableOfContents from "./toc";
|
|
import type { ConfigHeading, TypeTOC } from "./types.d.ts";
|
|
|
|
export interface Props {
|
|
title?: string;
|
|
headings?: ConfigHeading[];
|
|
types?: TypeTOC;
|
|
mobile: boolean;
|
|
}
|
|
|
|
const { title, headings, types, mobile } = Astro.props;
|
|
---
|
|
{(headings?.length ?? 0) + (types?.length ?? 0) != 0 &&
|
|
<div id="toc" aria-mobile={mobile} class=`toc-wrapper${mobile ? "-mobile":""}`>
|
|
<TableOfContents
|
|
title={title}
|
|
config={headings}
|
|
type={types}
|
|
mobile={mobile}
|
|
client:idle
|
|
/>
|
|
</div>
|
|
}
|