import { createSignal, type Component } from "solid-js"; import { Article } from "@icons"; import { Table } from "./Table"; import type { TOCProps, TypeTOC, ConfigHeading, } from "../types"; import { buildHierarchy } from "@config/io/helpers"; const TableOfContents: Component = props => { const [open, setOpen] = createSignal(false); const [typeProps] = createSignal( props.type ); const [configProps] = createSignal< ConfigHeading[] | undefined >(props.config); function toggle(e: MouseEvent) { e.preventDefault(); setOpen(!open()); } if (!props.mobile) { return typeProps() ? ( ) : (
); } return (
) : (
)} ); }; export default TableOfContents;