Files
sorsfonalak/services/frontend/src/components/NavLinks.tsx
T

18 lines
473 B
TypeScript
Raw Normal View History

"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
export function NavLinks({ links }: { links: { href: string; label: string }[] }) {
const pathname = usePathname();
return (
<nav className="nav" aria-label="Fő navigáció">
{links.map((l) => (
<Link key={l.href} href={l.href} aria-current={pathname.startsWith(l.href) ? "page" : undefined}>
{l.label}
</Link>
))}
</nav>
);
}