"use client"; import { cn } from "@suphark/ui/lib/utils"; import Link from "next/link"; import { usePathname } from "next/navigation"; import type { ComponentProps, ReactNode } from "react"; import { isNavActive } from "./types"; /** ลิงก์ที่ไฮไลต์เมื่อ path ปัจจุบันอยู่ใต้ href (prefix match) — ยกจาก Pi Auth */ export function NavLink({ href, children, exact = false, className, activeClassName = "bg-accent text-accent-foreground font-medium", ...props }: Omit, "href"> & { href: string; children: ReactNode; exact?: boolean; activeClassName?: string; }) { const pathname = usePathname(); const active = isNavActive(pathname, href, exact); return ( {children} ); }