"use client"

import Link from "next/link"
import { usePathname } from 'next/navigation'
import { LayoutDashboard, Database, Users, DollarSign, Brain, Settings, Home } from 'lucide-react'
import { cn } from "@/lib/utils"

const navItems = [
  { href: "/platform/dashboard", icon: LayoutDashboard, label: "平台总览" },
  { href: "/platform/data-management", icon: Database, label: "数据管理" },
  { href: "/platform/user-portrait", icon: Users, label: "用户画像" },
  { href: "/platform/value-assessment", icon: DollarSign, label: "价值评估" },
  { href: "/platform/ai-assistant", icon: Brain, label: "AI助手" },
]

export default function PlatformNav() {
  const pathname = usePathname()

  return (
    <nav className="fixed left-0 top-0 h-screen w-64 bg-white border-r border-gray-200 p-6">
      <div className="mb-8">
        <h2 className="text-2xl font-bold text-gray-900 mb-1">神射手</h2>
        <p className="text-sm text-gray-600">数据资产中台</p>
      </div>

      <div className="space-y-2">
        <Link
          href="/"
          className="flex items-center gap-3 px-4 py-3 rounded-lg transition-colors text-gray-600 hover:bg-gray-100 hover:text-gray-900"
        >
          <Home className="w-5 h-5" />
          <span className="font-medium">返回首页</span>
        </Link>
        
        {navItems.map((item) => {
          const Icon = item.icon
          const isActive = pathname === item.href

          return (
            <Link
              key={item.href}
              href={item.href}
              className={cn(
                "flex items-center gap-3 px-4 py-3 rounded-lg transition-colors",
                isActive
                  ? "bg-blue-50 text-blue-600 font-semibold"
                  : "text-gray-600 hover:bg-gray-100 hover:text-gray-900"
              )}
            >
              <Icon className="w-5 h-5" />
              <span className="font-medium">{item.label}</span>
            </Link>
          )
        })}
      </div>
    </nav>
  )
}
