import { useEffect, useState, useSyncExternalStore, type ReactNode } from "react"; import { Button } from "../components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogTitle, DialogTrigger } from "../components/ui/dialog"; const query = "(max-width: 767px)"; function subscribe(listener: () => void) { const media = window.matchMedia(query); media.addEventListener("change", listener); return () => media.removeEventListener("change", listener); } const isNarrow = () => window.matchMedia(query).matches; /** Keep the archive content readable on phones, using the shared accessible dialog. */ export function ArchiveNavigation({ surface, children }: { surface: string; children: ReactNode }) { const narrow = useSyncExternalStore(subscribe, isNarrow, () => false); const [open, setOpen] = useState(false); useEffect(() => { setOpen(false); }, [surface, narrow]); if (!narrow || !["memory-management", "evidence-management"].includes(surface)) return children; return
ThothII }>Navigation
Navigation Choose an administration page or a session.
{children}
; }