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%
751 B · 24 lines tsx
Raw Blame History
1'use client';23import { useTime } from '@/lib/time';45export function TimeToggle({ className = '' }: { className?: string }) {6  const { mode, setMode } = useTime();7  return (8    <div role="radiogroup" aria-label="Time zone" className={`inline-flex overflow-hidden rounded-[4px] border border-line text-[10.5px] tracking-[0.1em] ${className}`}>9      {(['utc', 'local'] as const).map((m) => (10        <button11          key={m}12          type="button"13          role="radio"14          aria-checked={mode === m}15          onClick={() => setMode(m)}16          className={`px-2 py-1 uppercase transition-colors ${mode === m ? 'bg-panel-2 text-ink' : 'text-ink-3 hover:text-ink-2'}`}17        >18          {m}19        </button>20      ))}21    </div>22  );23}24