import { NavLink } from 'react-router-dom'; import { LayoutDashboard, Radio, Monitor, FileText, Shield, MessageSquare, Sun, Moon, LogOut } from 'lucide-react'; import { useTheme } from '../../contexts/ThemeContext'; import { useAuth } from '../../contexts/AuthContext'; interface NavItem { to: string; icon: React.ReactNode; label: string; badge?: number; } const mainNav: NavItem[] = [ { to: '/', icon: , label: 'Overview' }, { to: '/signals', icon: , label: 'Regulatory Signals' }, { to: '/status', icon: , label: 'System Status' }, ]; const workbenchNav: NavItem[] = [ { to: '/documents', icon: , label: 'Documents' }, { to: '/compliance', icon: , label: 'Compliance Analysis' }, ]; const chatNav: NavItem[] = [ { to: '/chat', icon: , label: 'Regulation Q&A' }, ]; function NavGroup({ title, items }: { title: string; items: NavItem[] }) { return (
{title}
{items.map(item => ( `nav-item${isActive ? ' active' : ''}`} > {item.icon} {item.label} {item.badge !== undefined && item.badge > 0 && ( {item.badge} )} ))}
); } /** Avatar initials from username (up to 2 chars). */ function initials(name: string): string { const parts = name.trim().split(/[\s_-]+/); if (parts.length >= 2) return (parts[0][0] + parts[1][0]).toUpperCase(); return name.slice(0, 2).toUpperCase(); } export function Sidebar() { const { theme, toggleTheme } = useTheme(); const { user, logout } = useAuth(); return ( ); }