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';6import { routes } from '@/lib/site';78const ITEMS = [9 { href: routes.admin(), key: 'admin.nav.overview' },10 { href: routes.admin('coverage'), key: 'admin.nav.coverage' },11 { href: routes.admin('runs'), key: 'admin.nav.runs' },12 { href: routes.admin('issues'), key: 'admin.nav.issues' },13 { href: routes.admin('raw'), key: 'admin.nav.raw' },14] as const;1516export function AdminNav() {17 const pathname = usePathname();18 return (19 <nav aria-label={t('admin.title')} className="scrollbar-none -mx-1 min-w-0 overflow-x-auto">20 <ul className="flex items-center gap-0.5">21 {ITEMS.map((it) => {22 const active = pathname === it.href;23 return (24 <li key={it.href} className="shrink-0">25 <Link href={it.href} aria-current={active ? 'page' : undefined} className={cn('inline-flex h-10 items-center rounded-sm px-2.5 text-sm md:h-8', active ? 'bg-ink text-paper' : 'text-ink-2 hover:bg-surface-2 hover:text-ink')}>26 {t(it.key)}27 </Link>28 </li>29 );30 })}31 </ul>32 </nav>33 );34}35