import type { JSXElement } from "solid-js"; import { TableOfContents } from "@/partials/TableOfContents"; import { PrevNextLinks } from "@/components/PrevNextLinks"; import { usePageContext } from "vike-solid/usePageContext"; import { collectSections } from "@/libs/sections"; import { navigation } from "@/libs/navigation"; import { Prose } from "@/components/Prose"; type DocsLayoutProps = { children: JSXElement; title?: string; // frontmatter: { title?: string }; estimatedReadingTime?: string; // nodes: Array; }; export function DocsLayout(props: DocsLayoutProps) { // const tableOfContents = collectSections(nodes); 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}

)} */}
); }