'use client'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
export interface NavLinkProps {
href: string
children: React.ReactNode
icon?: React.ReactNode
className?: string
}
export function NavLink({ href, children, icon, className = '' }: NavLinkProps) {
const pathname = usePathname()
const isActive = pathname === href || (href !== '/' && pathname.startsWith(href))
return (
{icon && {icon}}
{children}
)
}