spb/countryatlas
Public
TypeScript 57%
Python 38.6%
JavaScript 3.6%
CSS 0.6%
1'use client';2import Link from 'next/link';3import { usePathname } from 'next/navigation';4import { t } from '@/i18n';5import { cn } from '@/lib/cn';67export function NavLinks({ items }: { items: Array<{ href: string; label: string }> }) {8 const pathname = usePathname();9 return (10 <nav aria-label={t('nav.primary')} className="hidden md:block">11 <ul className="flex items-center gap-0.5">12 {items.map((it) => {13 const active = pathname === it.href || pathname.startsWith(`${it.href}/`);14 return (15 <li key={it.href}>16 <Link href={it.href} aria-current={active ? 'page' : undefined} className={cn('inline-flex h-9 items-center rounded-sm px-2 text-sm xl:px-2.5', active ? 'font-medium text-ink' : 'text-ink-2 hover:bg-surface-2 hover:text-ink')}>17 {it.label}18 </Link>19 </li>20 );21 })}22 </ul>23 </nav>24 );25}26