"use client"; import * as Dialog from "@radix-ui/react-dialog"; import { usePathname } from "next/navigation"; import { useEffect, useRef } from "react"; import { Sidebar, useSidebarStore } from "components/ActionBar/Sidebar"; import { MobileNavigation } from "components/ActionBar/MobileNavigation"; import { ManualNavigation } from "./ManualNavigation"; import { ManualPagination } from "./ManualPagination"; import { findManualPage } from "./nav"; export function ManualShell(props: { children: React.ReactNode }) { let { open, setOpen } = useSidebarStore(); let pathname = usePathname(); let content = useRef(null); // The scroll container lives in the layout, so it survives navigation // between manual pages and would otherwise keep the previous page's offset. useEffect(() => { content.current?.scrollTo(0, 0); }, [pathname]); let match = findManualPage(pathname); let pageTitle = match?.page?.name ?? match?.section.name ?? "Manual"; return (
Manual navigation setOpen(false)} />
{props.children}
); }