import { useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { Home, FileText, Activity, Search, Settings } from 'lucide-react'; import { useAuth } from '../auth/AuthContext'; interface NavItem { path: string; label: string; icon: React.ElementType; title: string; } const navItems: NavItem[] = [ { path: '/', label: 'Home', icon: Home, title: 'Home' }, { path: '/documents', label: 'Documents', icon: FileText, title: 'Documents' }, { path: '/progress', label: 'Progress', icon: Activity, title: 'Progress' }, { path: '/activity', label: 'Activity', icon: Activity, title: 'Activity' }, { path: '/search', label: 'Search', icon: Search, title: 'Search' }, ]; const adminSubItems: NavItem[] = [ { path: '/admin', label: 'General', icon: Settings, title: 'General' }, { path: '/admin/import', label: 'Import', icon: Settings, title: 'Import' }, { path: '/admin/users', label: 'Users', icon: Settings, title: 'Users' }, { path: '/admin/logs', label: 'Logs', icon: Settings, title: 'Logs' }, ]; // Helper function to check if pathname has a prefix function hasPrefix(path: string, prefix: string): boolean { return path.startsWith(prefix); } export default function HamburgerMenu() { const location = useLocation(); const { user } = useAuth(); const [isOpen, setIsOpen] = useState(false); const isAdmin = user?.is_admin ?? false; return (