'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useState } from 'react'; import { Bike, Settings, Wallet, Store, Zap, Battery, Menu, X, Users, FileText, BarChart3, CreditCard, MapPin, Shield, Truck, ChevronDown, LogOut, Calculator, Wrench } from 'lucide-react'; const adminNavItems = [ { label: 'Dashboard', href: '/admin', icon: BarChart3 }, { label: 'KYC Requests', href: '/admin/kyc', icon: Shield }, { label: 'Rentals', href: '/admin/rentals', icon: FileText }, { label: 'Bikers', href: '/admin/bikers', icon: Users }, { label: 'Investors', href: '/admin/investors', icon: Wallet }, { label: 'Fleet Management', href: '/admin/fleet', icon: Bike }, { label: 'Damage & Maintenance', href: '/admin/maintenance', icon: Wrench }, { label: 'Accounting', href: '/admin/accounting', icon: Calculator }, { label: 'Hubs', href: '/admin/hub', icon: MapPin }, { label: 'Reports', href: '/admin/reports', icon: BarChart3 }, ]; const bikerNavItems = [ { label: 'Biker Dashboard', href: '/', icon: Bike }, { label: 'Rent Bike', href: '/rent', icon: Zap }, { label: 'Browse EVs', href: '/bikes', icon: Battery }, ]; const investorNavItems = [ { label: 'Dashboard', href: '/investor', icon: Wallet }, { label: 'Portfolio', href: '/investor/portfolio', icon: BarChart3 }, { label: 'Withdraw', href: '/investor/withdraw', icon: CreditCard }, ]; const shopNavItems = [ { label: 'Dashboard', href: '/shop', icon: Store }, { label: 'Deliveries', href: '/shop/deliveries', icon: Truck }, { label: 'Fleet', href: '/shop/fleet', icon: Bike }, ]; export default function Sidebar() { const pathname = usePathname(); const [mobileOpen, setMobileOpen] = useState(false); const [expandedMenu, setExpandedMenu] = useState(null); const isAdmin = pathname.startsWith('/admin'); const isInvestor = pathname.startsWith('/investor'); const isShop = pathname.startsWith('/shop'); const navItems = isAdmin ? adminNavItems : isInvestor ? investorNavItems : isShop ? shopNavItems : bikerNavItems; const toggleMenu = (label: string) => { setExpandedMenu(expandedMenu === label ? null : label); }; return ( <> {mobileOpen && (
setMobileOpen(false)} /> )} ); }