"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState } from "react"; import { CreditCard, Gear, ListCheck, Person, PlugConnection, Thunderbolt, ThunderboltFill, Xmark, Bars, } from "@gravity-ui/icons"; import SidebarFooter from "@/components/sidebar-footer"; import { useSession } from "@/lib/auth-client"; const chargeItems = [ { href: "/dashboard/charge", label: "立即充电", icon: ThunderboltFill, adminOnly: false }, ]; const navItems = [ { href: "/dashboard", label: "概览", icon: Thunderbolt, exact: true, adminOnly: false }, { href: "/dashboard/charge-points", label: "充电桩", icon: PlugConnection, adminOnly: false }, { href: "/dashboard/transactions", label: "充电记录", icon: ListCheck, adminOnly: false }, { href: "/dashboard/id-tags", label: "储值卡", icon: CreditCard, adminOnly: false }, { href: "/dashboard/users", label: "用户管理", icon: Person, adminOnly: true }, ]; const settingsItems = [{ href: "/dashboard/settings", label: "账号设置", icon: Gear }]; function NavContent({ pathname, isAdmin, onNavigate, }: { pathname: string; isAdmin: boolean; onNavigate?: () => void; }) { return ( <> {/* Logo */}