import { Link, useLocation } from "react-router-dom"; import { pageTitles } from "../data/nav"; type TopBarProps = { collapsed: boolean; onToggle: () => void; }; export function TopBar({ collapsed, onToggle }: TopBarProps) { const location = useLocation(); const meta = pageTitles.get(location.pathname); const section = meta?.section?.includes("Demo") || meta?.section?.includes("Prototype") ? "Demos" : "Docs"; let title = meta?.title ?? "Overview"; // Custom (dynamic) pages aren't in the static pageTitles registry. if (location.pathname.startsWith("/docs/custom")) { if (location.pathname === "/docs/custom") title = "Custom Pages"; else if (location.pathname.endsWith("/new")) title = "New Page"; else title = "Custom Page"; } return (
VOID::NAV / {section} / {title}
Connected Prototype v0.1.0
); }