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.3 KB · 32 lines tsx
Raw Blame History
1'use client';23import { useDegraded } from '@/lib/live';4import { Time } from '@/lib/time';56/** Spec §57 — our own failure must never be read as an Internet event. Shown whenever internal_status ≠ ok or stale. */7export function DegradedBanner() {8  const { degraded, status, reason, frozenSince } = useDegraded();9  if (!degraded) return null;10  return (11    <div role="status" className="border-b border-warn/40 bg-[rgba(233,196,106,0.08)] px-4 py-2 text-[12.5px] text-ink">12      <div className="mx-auto flex max-w-[1440px] flex-wrap items-center gap-x-3 gap-y-1">13        <span className="inline-flex items-center gap-2 font-medium uppercase tracking-[0.12em] text-warn">14          <span className="size-1.5 rounded-full bg-warn" aria-hidden="true" />15          Instrument degraded16        </span>17        <span className="text-ink-2">18          {status === 'stale' ? 'The pressure engine has not run recently.' : 'Too few fresh probes, stale BGP feed or unhealthy stores.'} The score is frozen19          {frozenSince && (20            <>21              {' '}22              since <Time ts={frozenSince} style="short" className="num text-ink" />23            </>24          )}{' '}25          and must not be read as an Internet event.26          {reason && <span className="text-ink-3"> — {reason}</span>}27        </span>28      </div>29    </div>30  );31}32