"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,
Users,
Target,
X,
ChevronDown,
ChevronRight,
Tag,
BarChart3,
TrendingUp,
} 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,
"user-value": 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-integration",
icon: ,
primary: true,
tag: "核心",
description: "多源数据整合平台",
},
{
title: "用户画像",
href: "/user-portrait",
icon: ,
primary: true,
expandable: true,
section: "user-portrait",
description: "用户标签与分群分析",
children: [
{
title: "流量关键词",
href: "/user-portrait/keywords",
icon: ,
description: "关键词价值评估",
},
{
title: "标签管理",
href: "/user-portrait/tags",
icon: ,
description: "用户标签分类",
},
],
},
{
title: "价值评估",
href: "/user-value",
icon: ,
primary: true,
expandable: true,
section: "user-value",
description: "用户价值分析模型",
children: [
{
title: "估值模型",
href: "/user-value/model",
icon: ,
description: "RFM价值模型",
},
{
title: "升级路径",
href: "/user-value/upgrade-paths",
icon: ,
description: "用户价值提升",
},
],
},
]
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 (
<>
{/* 背景遮罩 */}
{/* 侧边栏 */}
{/* 头部 */}
{/* 导航菜单 */}
{/* 底部信息 */}
>
)
}