'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { useState } from 'react' import { CreditCard, ListCheck, Person, PlugConnection, Thunderbolt, Xmark, Bars } from '@gravity-ui/icons' import SidebarFooter from '@/components/sidebar-footer' const navItems = [ { href: '/dashboard', label: '概览', icon: Thunderbolt, exact: true }, { href: '/dashboard/charge-points', label: '充电桩', icon: PlugConnection }, { href: '/dashboard/transactions', label: '充电记录', icon: ListCheck }, { href: '/dashboard/id-tags', label: '储值卡', icon: CreditCard }, { href: '/dashboard/users', label: '用户管理', icon: Person }, ] function NavContent({ pathname, onNavigate }: { pathname: string; onNavigate?: () => void }) { return ( <> {/* Logo */}
Helios EVCS
{/* Navigation */} {/* Footer */} ) } export default function Sidebar() { const pathname = usePathname() const [open, setOpen] = useState(false) return ( <> {/* Mobile top bar */}
Helios EVCS
{/* Mobile drawer overlay */} {open && (
setOpen(false)} /> )} {/* Mobile drawer */} {/* Desktop sidebar */} ) }