Files
users/components/main-nav.tsx
v0 22e725887a refactor: restructure project into 5 core modules
Organize project by 5 core modules based on requirement docs.

Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
2026-01-31 04:18:24 +00:00

62 lines
1.5 KiB
TypeScript

"use client"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { cn } from "@/lib/utils"
import { LayoutDashboard, Database, Users, BarChart3, Bot } from "lucide-react"
export function MainNav() {
const pathname = usePathname()
const routes = [
{
href: "/",
label: "首页",
icon: LayoutDashboard,
active: pathname === "/",
},
{
href: "/data-platform",
label: "数据中台",
icon: Database,
active: pathname.startsWith("/data-platform"),
},
{
href: "/user-portrait",
label: "用户画像",
icon: Users,
active: pathname.startsWith("/user-portrait"),
},
{
href: "/value-assessment",
label: "价值评估",
icon: BarChart3,
active: pathname.startsWith("/value-assessment"),
},
{
href: "/ai-assistant",
label: "AI助手",
icon: Bot,
active: pathname.startsWith("/ai-assistant"),
},
]
return (
<nav className="flex items-center space-x-4 lg:space-x-6 mx-6">
{routes.map((route) => (
<Link
key={route.href}
href={route.href}
className={cn(
"text-sm font-medium transition-colors hover:text-primary flex items-center gap-2",
route.active ? "text-black dark:text-white" : "text-muted-foreground",
)}
>
<route.icon className="h-4 w-4" />
{route.label}
</Link>
))}
</nav>
)
}