import type { JSXElement } from "solid-js"; // import { TableOfContents } from "@/partials/TableOfContents"; import { PrevNextLinks } from "@/components/PrevNextLinks"; import { usePageContext } from "vike-solid/usePageContext"; import { clientOnly } from "vike-solid/clientOnly"; import { clock } from "solid-heroicons/outline"; import { navigation } from "@/libs/navigation"; import { Prose } from "@/components/Prose"; import { Icon } from "solid-heroicons"; type DocsLayoutProps = { children: JSXElement; }; const TableOfContents = clientOnly( async () => (await import("@/partials/TableOfContents")).TableOfContents, ); export function DocsLayout(props: DocsLayoutProps) { const pageContext = usePageContext(); return ( <>
{props.children}
); } type DocsHeaderProps = { title?: string; estimatedReadingTime?: string; }; export function DocsHeader(props: DocsHeaderProps) { const pageContext = usePageContext(); const getSection = () => { return navigation.find((section) => section.links.find((link) => link.href === pageContext.urlPathname), ); }; if (!props.title && !getSection()) { return null; } return (
{getSection() && (

{getSection()?.title}

)} {props.title && (

{props.title}

)} {props.estimatedReadingTime && (

{props.estimatedReadingTime}

)}
); }