portfolio/app/components/NavItem.tsx

16 lines
422 B
TypeScript
Raw Normal View History

'use client'
2026-02-08 19:40:39 +01:00
import Link from "next/link";
import { usePathname } from "next/navigation";
2026-02-08 19:40:39 +01:00
export default function NavItem({
children,
href
}: Readonly<{
children: React.ReactNode;
href: string;
}>) {
const highlighted = usePathname() === href;
return <Link href={href} className={`text-lg mx-4 flex font-semibold ${highlighted && 'underline underline-offset-8'}`}>
2026-02-08 19:40:39 +01:00
{children}
</Link>
}