"use client" import { useState } from "react" import Link from "next/link" import { usePathname } from "next/navigation" import { cn } from "@/lib/utils" import { Database, LayoutDashboard, Settings, Users, Target, ChevronLeft, ChevronDown, ChevronRight, Tag, BarChart3, TrendingUp, } from "lucide-react" import { Badge } from "@/components/ui/badge" export default function Sidebar() { const pathname = usePathname() const [expanded, setExpanded] = useState(true) const [expandedSections, setExpandedSections] = useState({ "user-portrait": true, "user-value": false, }) const toggleSidebar = () => { setExpanded(!expanded) } const toggleSection = (section: string) => { setExpandedSections((prev) => ({ ...prev, [section]: !prev[section], })) } // 重新设计的导航结构 const navItems = [ { title: "概览", href: "/", icon: , primary: true, }, { title: "数据集成", href: "/data-integration", icon: , primary: true, tag: "核心", }, { title: "用户画像", href: "/user-portrait", icon: , primary: true, expandable: true, section: "user-portrait", children: [ { title: "用户词", href: "/user-portrait/user-keywords", icon: , }, { title: "标签管理", href: "/user-portrait/tags", icon: , }, ], }, { title: "用户估值", href: "/user-value", icon: , primary: true, expandable: true, section: "user-value", children: [ { title: "估值模型", href: "/user-value/model", icon: , }, { title: "用户升级路径", href: "/user-value/upgrade-paths", icon: , }, ], }, ] const getTagColor = (tag: string) => { switch (tag) { case "核心": return "glass-light text-orange-700 border-orange-200" default: return "glass-light text-gray-700 border-gray-200" } } return (
{/* 头部 */}
{expanded ? (

用户数字资产中台

) : (
)}
{/* 导航菜单 */}
{/* 底部设置和折叠按钮 */}
{expanded && 设置}
) }