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 { urlPathname } = usePageContext(); const section = navigation.find((section) => section.links.find((link) => link.href === urlPathname), ); if (!props.title && !section) { return null; } return (
{section && (

{section.title}

)} {props.title && (

{props.title}

)} {props.estimatedReadingTime && (

{props.estimatedReadingTime}

)}
); }