diff --git a/dashboard/web/src/components/sidebar-nav.tsx b/dashboard/web/src/components/sidebar-nav.tsx new file mode 100644 index 0000000..01edff6 --- /dev/null +++ b/dashboard/web/src/components/sidebar-nav.tsx @@ -0,0 +1,152 @@ +'use client'; + +import { useState } from 'react'; +import Link from 'next/link'; +import { usePathname, useRouter } from 'next/navigation'; +import { + LayoutDashboard, + Activity, + BarChart3, + Cpu, + Key, + Code2, + Settings, + LogOut, + Menu, + X, + Sun, + Moon, + HeartPulse, +} from 'lucide-react'; +import { useAuth } from '@/lib/auth'; + +const navItems = [ + { href: '/', label: 'Dashboard', icon: LayoutDashboard }, + { href: '/health', label: 'Health', icon: HeartPulse }, + { href: '/metrics', label: 'Metrics', icon: BarChart3 }, + { href: '/system', label: 'System', icon: Cpu }, + { href: '/env', label: 'Environment', icon: Key }, + { href: '/code-quality', label: 'Code Quality', icon: Code2 }, + { href: '/settings/cosmos', label: 'Settings', icon: Settings }, +]; + +export function SidebarNav() { + const pathname = usePathname(); + const router = useRouter(); + const { user, logout } = useAuth(); + const [mobileOpen, setMobileOpen] = useState(false); + const [theme, setTheme] = useState('light'); + + const handleLogout = () => { + logout(); + router.push('/login'); + }; + + const initials = user?.email + ? user.email.slice(0, 2).toUpperCase() + : '??'; + + const sidebarContent = ( + <> + {/* Logo */} +
Dashboard
+{user?.email ?? 'Admin'}
+{user?.role ?? 'admin'}
+