"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, Target, ChevronLeft, ChevronDown, ChevronRight, Tag, UserCheck, Layers, BrainCircuit, Smartphone, } 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, // 用户画像默认展开 }) const toggleSidebar = () => { setExpanded(!expanded) } const toggleSection = (section: string) => { setExpandedSections((prev) => ({ ...prev, [section]: !prev[section], })) } // 重新设计的导航结构 - 遵循新规则 const navItems = [ { title: "数据概览", href: "/", icon: , primary: true, }, { title: "数据中台", href: "/data-platform", icon: , primary: true, tag: "核心", }, { title: "用户画像", // 整合用户池功能 href: "/user-portrait", icon: , primary: true, expandable: true, section: "user-portrait", children: [ { title: "用户管理", // 原用户池的用户管理 href: "/user-portrait/management", icon: , }, { title: "用户分群", // 原用户池的用户分群 href: "/user-portrait/segmentation", icon: , }, { title: "标签管理", // 原用户画像的标签管理 href: "/user-portrait/tags", icon: , }, ], }, { title: "设备管理", // 提升为一级菜单 [^2] href: "/devices", icon: , primary: true, }, { title: "AI智能助手", // 新增AI智能助手 href: "/ai-assistant", icon: , primary: true, }, ] 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 && 设置}
) }