import { usePageContext } from "vike-react/usePageContext"; import { ClockIcon } from "@heroicons/react/24/outline"; import { navigation } from "@/lib/navigation"; 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}

)}
); }