"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import Icon from "./Icon"; const NAV = [ { id: "workspace", label: "工作台", icon: "home" as const, href: "/" }, { id: "play", label: "试拍台", icon: "play" as const, href: "/play" }, { id: "projects", label: "项目", icon: "clapperboard" as const, href: "/projects", chev: true, }, { id: "products", label: "商品库", icon: "package" as const, href: "/products" }, { id: "library", label: "资产库", icon: "images" as const, href: "/library" }, { id: "usage", label: "用量", icon: "bars2" as const, href: "/usage" }, { id: "api", label: "API Keys", icon: "key" as const, href: "/api-keys" }, { id: "settings", label: "设置", icon: "cog" as const, href: "/settings" }, ]; function isActive(pathname: string, href: string): boolean { if (href === "/") return pathname === "/"; return pathname === href || pathname.startsWith(href + "/"); } export default function Sidebar() { const pathname = usePathname(); // /account is reached via the user pill in the topbar — not in nav. return ( ); }