import { usePageContext } from "vike-react/usePageContext"; import { navigation } from "@/lib/navigation"; export function DocsHeader({ title }: { title?: string }) { const { urlPathname } = usePageContext(); const section = navigation.find((section) => section.links.find((link) => link.href === urlPathname)); if (!title && !section) { return null; } return (
{section &&

{section.title}

} {title &&

{title}

}
); }