import { Link, useLocation, useParams } from 'react-router'; import { Server, LayoutDashboard, Network, Settings, Users, Shield, Gamepad2, ScrollText, ChevronLeft, } from 'lucide-react'; import { cn } from '@source/ui'; import { Button } from '@/components/ui/button'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Separator } from '@/components/ui/separator'; import { useAuthStore } from '@/stores/auth'; interface NavItem { label: string; href: string; icon: React.ComponentType<{ className?: string }>; } export function Sidebar() { const location = useLocation(); const { orgId } = useParams(); const user = useAuthStore((s) => s.user); const orgNav: NavItem[] = orgId ? [ { label: 'Dashboard', href: `/org/${orgId}/dashboard`, icon: LayoutDashboard }, { label: 'Servers', href: `/org/${orgId}/servers`, icon: Server }, { label: 'Nodes', href: `/org/${orgId}/nodes`, icon: Network }, { label: 'Members', href: `/org/${orgId}/settings/members`, icon: Users }, { label: 'Settings', href: `/org/${orgId}/settings`, icon: Settings }, ] : []; const adminNav: NavItem[] = user?.isSuperAdmin ? [ { label: 'Users', href: '/admin/users', icon: Users }, { label: 'Games', href: '/admin/games', icon: Gamepad2 }, { label: 'Nodes', href: '/admin/nodes', icon: Network }, { label: 'Audit Logs', href: '/admin/audit-logs', icon: ScrollText }, ] : []; return (
GamePanel
{orgId && (
Organizations
)} {!orgId && (

ORGANIZATIONS

)} {adminNav.length > 0 && ( <>

ADMIN

)}
); } function NavSection({ items, currentPath }: { items: NavItem[]; currentPath: string }) { return ( ); }