Files
2026-07-13 12:49:11 +08:00

34 lines
733 B
TypeScript

"use client"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { cn } from "@/lib/utils"
export function MainNav({
items,
className,
...props
}: React.ComponentProps<"nav"> & {
items: { href: string; label: string }[]
}) {
const pathname = usePathname()
return (
<nav className={cn("flex items-center gap-6", className)} {...props}>
{items.map((item) => (
<Link
key={item.href}
href={item.href}
className={cn(
"text-sm font-medium transition-colors hover:text-white",
pathname === item.href ? "text-white" : "text-white/70"
)}
>
{item.label}
</Link>
))}
</nav>
)
}