"use client"
import { useEffect, useState } from "react"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { cn } from "@/lib/utils"
import {
Database,
LayoutDashboard,
Target,
X,
ChevronDown,
ChevronRight,
UserCheck,
Layers,
Tag,
BrainCircuit,
} from "lucide-react"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
interface MobileSidebarProps {
isOpen: boolean
onClose: () => void
}
export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) {
const pathname = usePathname()
const [expandedSections, setExpandedSections] = useState({
"user-portrait": false, // 用户画像默认不展开
})
const toggleSection = (section: string) => {
setExpandedSections((prev) => ({
...prev,
[section]: !prev[section],
}))
}
useEffect(() => {
if (isOpen) {
document.body.style.overflow = "hidden"
} else {
document.body.style.overflow = "unset"
}
return () => {
document.body.style.overflow = "unset"
}
}, [isOpen])
const navItems = [
{
title: "数据概览",
href: "/",
icon: ,
primary: true,
description: "平台整体数据分析",
},
{
title: "数据中台",
href: "/data-platform",
icon: ,
primary: true,
tag: "核心",
description: "多源数据整合中心",
},
{
title: "用户画像", // 整合用户池功能
href: "/user-portrait",
icon: ,
primary: true,
expandable: true,
section: "user-portrait",
description: "用户数据管理与画像分析",
children: [
{
title: "用户管理", // 原用户池的用户管理
href: "/user-portrait/management",
icon: ,
description: "IMEI、手机号管理",
},
{
title: "用户分群", // 原用户池的用户分群
href: "/user-portrait/segmentation",
icon: ,
description: "智能用户分群",
},
{
title: "标签管理", // 原用户画像的标签管理
href: "/user-portrait/tags",
icon: ,
description: "用户标签体系",
},
],
},
{
title: "AI智能助手", // 新增AI智能助手
href: "/ai-assistant",
icon: ,
primary: true,
description: "AI数据分析与营销策略",
},
]
const getTagColor = (tag: string) => {
switch (tag) {
case "核心":
return "bg-blue-100 text-blue-700 border-blue-200"
default:
return "bg-gray-100 text-gray-700 border-gray-200"
}
}
return (
<>
{/* 背景遮罩 */}
{/* 侧边栏 */}
{/* 头部 */}
{/* 导航菜单 */}
{/* 底部信息 */}
>
)
}