import { NavLink } from 'react-router-dom' import { Home, Settings, PanelLeftClose, PanelLeftOpen, Headphones, BookOpen, Users, FolderCog, ScanLine, ServerCog, } from 'lucide-react' import { cn } from '@/lib/cn' import { useSettingsStore } from '@/store/settingsStore' import { useLibraryStore } from '@/store/libraryStore' import { useIsAdmin } from '@/store/authStore' interface ItemProps { to: string label: string icon: React.ReactNode collapsed: boolean end?: boolean } function NavItem({ to, label, icon, collapsed, end }: ItemProps) { return ( cn( 'group relative flex items-center gap-3 rounded px-3 py-2 text-sm transition-colors', 'hover:bg-surface-2', isActive ? 'bg-surface-2 font-medium text-text' : 'text-text-muted', ) } > {({ isActive }) => ( <> {icon} {!collapsed && {label}} )} ) } function SectionLabel({ children, collapsed }: { children: string; collapsed: boolean }) { if (collapsed) return
return (

{children}

) } export function Sidebar() { const collapsed = useSettingsStore((s) => s.sidebarCollapsed) const toggle = useSettingsStore((s) => s.toggleSidebar) const libraries = useLibraryStore((s) => s.libraries) const isAdmin = useIsAdmin() return ( ) }