2026-02-08 22:20:47 +01:00
|
|
|
'use client'
|
2026-02-08 19:40:39 +01:00
|
|
|
import Link from "next/link";
|
2026-02-08 22:20:47 +01:00
|
|
|
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;
|
|
|
|
|
}>) {
|
2026-02-12 22:08:36 +01:00
|
|
|
const highlighted = usePathname() == href;
|
2026-02-13 10:06:48 +01:00
|
|
|
return (
|
|
|
|
|
<Link
|
|
|
|
|
href={href}
|
|
|
|
|
className={`group relative text-lg mx-4 flex font-semibold hover:scale-110 active:rotate-4`}
|
|
|
|
|
>
|
|
|
|
|
<span>{children}</span>
|
|
|
|
|
<span
|
|
|
|
|
className={`absolute left-0 bottom-0 h-[2px] w-full bg-current transform transition-transform duration-200 origin-left group-hover:scale-x-100 ${highlighted ? 'scale-x-100 scale-y-100' : 'scale-x-0 scale-y-50'}`}
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
2026-02-08 19:40:39 +01:00
|
|
|
}
|