import type { LucideIcon } from 'lucide-react'; import { NavLink } from 'react-router'; import { Server, Laptop, Users, KeyRound, Smartphone, ShieldCheck, Activity, TerminalSquare } from 'lucide-react'; import { HEADSCALE_SECTIONS, headscaleSectionPath, type HeadscaleSectionId } from './shared'; import { useHeadscaleServers } from './useHeadscaleServers'; // Lower-left panel of the /headscale workspace: the section list. Which server it all acts on is the panel // above (HeadscaleServerPicker) — that one mutates, this one navigates, which is why they are separate. // // Sections are real links to /headscale/
, not channel writes — so they cmd-click into a new tab, // survive a reload, and answer the back button. Active state comes from react-router's NavLink rather than // being derived in JS, per the navigation audit's Phase 4. const ICONS: Record = { servers: Server, nodes: Laptop, users: Users, keys: KeyRound, invites: Smartphone, policy: ShieldCheck, diagnostics: Activity, console: TerminalSquare, }; const ROW = 'group relative flex items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors'; type SectionBodyProps = { icon: LucideIcon; label: string; selected: boolean }; const SectionBody = ({ icon: Icon, label, selected }: SectionBodyProps) => ( <> {selected && } {label} ); export const HeadscaleNav = () => { const { active } = useHeadscaleServers(); return (
); };