SPB Git forge
15commits 1branches 0releases
29.7 MBsize
maindefault branch
10 days agolast push
TypeScript 36.3% Python 31.8% Go 18% JavaScript 9.8% Shell 1.9% SQL 1.4% CSS 0.5%
1.2 KB · 40 lines tsx
Raw Blame History
1'use client';23import Link from 'next/link';4import { usePathname } from 'next/navigation';56const LINKS: [string, string][] = [7  ['/', 'Gauge'],8  ['/incidents', 'Incidents'],9  ['/services', 'Services'],10  ['/asns', 'ASNs'],11  ['/routes', 'Routes'],12  ['/bgp', 'BGP'],13  ['/probes', 'Probes'],14  ['/history', 'History'],15  ['/methodology', 'Methodology'],16  ['/api', 'API'],17];1819export function NavLinks({ className = '', compact = false }: { className?: string; compact?: boolean }) {20  const path = usePathname();21  return (22    <nav aria-label="Primary" className={`items-center gap-1 ${className}`}>23      {LINKS.map(([href, label]) => {24        const active = href === '/' ? path === '/' : path.startsWith(href);25        return (26          <Link27            key={href}28            href={href}29            aria-current={active ? 'page' : undefined}30            className={`whitespace-nowrap rounded-[3px] px-2 text-[11.5px] tracking-[0.04em] transition-colors ${compact ? 'py-2' : 'py-1'} ${active ? 'text-ink' : 'text-ink-2 hover:text-ink'}`}31            style={active ? { boxShadow: 'inset 0 -1px 0 var(--accent)' } : undefined}32          >33            {label}34          </Link>35        );36      })}37    </nav>38  );39}40