import { Link, useLocation } from 'react-router-dom' import { useAuth } from '../../context/AuthContext' import { useTheme } from '../../context/ThemeContext' import LogOut from 'lucide-react/dist/esm/icons/log-out' import Sun from 'lucide-react/dist/esm/icons/sun' import Moon from 'lucide-react/dist/esm/icons/moon' import LayoutDashboard from 'lucide-react/dist/esm/icons/layout-dashboard' import FlaskConical from 'lucide-react/dist/esm/icons/flask-conical' import Users from 'lucide-react/dist/esm/icons/users' import BookOpen from 'lucide-react/dist/esm/icons/book-open' import ClipboardList from 'lucide-react/dist/esm/icons/clipboard-list' import Bookmark from 'lucide-react/dist/esm/icons/bookmark' import clsx from 'clsx' export default function Navbar() { const { user, logout, loading } = useAuth() const { theme, toggle } = useTheme() const location = useLocation() const isAdmin = user?.role === 'admin' const adminLinks = [ { to: '/admin', label: 'Dashboard', icon: LayoutDashboard }, { to: '/admin/tests', label: 'Tests', icon: FlaskConical }, { to: '/admin/users', label: 'Users', icon: Users }, ] const aspirantLinks = [ { to: '/dashboard', label: 'Dashboard', icon: LayoutDashboard }, { to: '/tests', label: 'Tests', icon: BookOpen }, { to: '/results', label: 'Results', icon: ClipboardList }, { to: '/bookmarks', label: 'Bookmarks', icon: Bookmark }, ] const links = isAdmin ? adminLinks : aspirantLinks const isActive = (to) => location.pathname === to || (to !== '/admin' && to !== '/dashboard' && location.pathname.startsWith(to)) return ( <> {/* ── Desktop/Tablet Top Bar ────────────────────────────────── */} {/* ── Mobile Bottom Navigation ──────────────────────────────── */} ) }