/** * Sidebar Component * Navigation sidebar with menu items */ import { NavLink } from 'react-router-dom'; import { Home, MessageSquare, Radio, Puzzle, Clock, Settings, ChevronLeft, ChevronRight, Terminal, ExternalLink, } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useSettingsStore } from '@/stores/settings'; import { useGatewayStore } from '@/stores/gateway'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; interface NavItemProps { to: string; icon: React.ReactNode; label: string; badge?: string; collapsed?: boolean; } function NavItem({ to, icon, label, badge, collapsed }: NavItemProps) { return ( cn( 'flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors', 'hover:bg-accent hover:text-accent-foreground', isActive ? 'bg-accent text-accent-foreground' : 'text-muted-foreground', collapsed && 'justify-center px-2' ) } > {icon} {!collapsed && ( <> {label} {badge && ( {badge} )} )} ); } export function Sidebar() { const sidebarCollapsed = useSettingsStore((state) => state.sidebarCollapsed); const setSidebarCollapsed = useSettingsStore((state) => state.setSidebarCollapsed); const devModeUnlocked = useSettingsStore((state) => state.devModeUnlocked); const gatewayStatus = useGatewayStore((state) => state.status); // Open developer console const openDevConsole = () => { window.electron.openExternal('http://localhost:18789'); }; const navItems = [ { to: '/', icon: , label: 'Dashboard' }, { to: '/chat', icon: , label: 'Chat' }, { to: '/channels', icon: , label: 'Channels' }, { to: '/skills', icon: , label: 'Skills' }, { to: '/cron', icon: , label: 'Cron Tasks' }, { to: '/settings', icon: , label: 'Settings' }, ]; return ( ); }