"use client"; import { useState } from "react"; import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"; import { ListIcon, XIcon } from "lucide-react"; import { useReport } from "../hooks/useReport"; import { TocContent } from "./ReportToc"; /** * Narrow-screen table of contents: a left-sliding drawer holding the same * `TocContent` (and scroll-spy) as the sticky sidebar. The trigger is * `lg:hidden`, so on wide screens the sidebar shows instead and this stays out * of the way. Following a link closes the drawer so the scenario is revealed. */ export function ReportTocDrawer() { const report = useReport(); const [open, setOpen] = useState(false); if (report.features.length === 0) return null; return ( Contents
Contents
setOpen(false)} />
); }