import { NavLink } from "react-router-dom"; import { useState } from "react"; import { LayoutDashboard, Shield, FlaskConical, BookOpen, BarChart3, Settings, Users, FileText, ChevronDown, ListChecks, ClipboardList, Database, Crosshair, Zap, Grid3X3, Gauge, ShieldCheck, GitCompareArrows, } from "lucide-react"; import { useAuth } from "../context/AuthContext"; interface NavItem { to: string; label: string; icon: React.FC<{ className?: string }>; children?: NavItem[]; } const mainLinks: NavItem[] = [ { to: "/dashboard", label: "Dashboard", icon: LayoutDashboard }, { to: "/techniques", label: "ATT&CK Matrix", icon: Shield }, { to: "/matrix", label: "Advanced Heatmap", icon: Grid3X3 }, { to: "/tests", label: "Tests", icon: FlaskConical, children: [ { to: "/tests", label: "All Tests", icon: ListChecks }, { to: "/tests?view=pending", label: "My Pending Tasks", icon: ClipboardList }, { to: "/test-catalog", label: "Test Catalog", icon: BookOpen }, ], }, { to: "/executive-dashboard", label: "Executive Dashboard", icon: Gauge }, { to: "/reports", label: "Reports", icon: BarChart3 }, { to: "/threat-actors", label: "Threat Actors", icon: Crosshair }, { to: "/campaigns", label: "Campaigns", icon: Zap }, { to: "/comparison", label: "Comparison", icon: GitCompareArrows }, { to: "/compliance", label: "Compliance", icon: ShieldCheck }, ]; const adminLinks: NavItem[] = [ { to: "/users", label: "Users", icon: Users }, { to: "/audit", label: "Audit Log", icon: FileText }, { to: "/data-sources", label: "Data Sources", icon: Database }, { to: "/system", label: "System", icon: Settings }, ]; function SidebarLink({ item }: { item: NavItem }) { const [expanded, setExpanded] = useState(false); if (item.children) { return (