'use client' import Link from 'next/link' import { usePathname } from 'next/navigation' import { cn } from '@/lib/utils' interface NavLinkProps { href: string children: React.ReactNode exact?: boolean } /** * Navigation link component with active state handling * Features: Bold active state, underline animation on hover * * @param href - The link URL * @param children - Link content * @param exact - Whether to match exact path * @returns JSX.Element - Navigation link */ export function NavLink({ href, children, exact = false }: NavLinkProps) { const pathname = usePathname() // Calculate isActive with proper route matching const isActive = exact ? pathname === href : href === '/' ? pathname === '/' : pathname === href || pathname.startsWith(`${href}/`) return ( {children} ) }