import Link from 'next/link';
import { Empty, PNum, StatusDot } from '@/components/ui/primitives';
import { fmt, fmtInt, fmtMs, fmtPct } from '@/lib/format';
import { Time } from '@/lib/time';
import type { CountryTargetRow, LatencyPair, Probe, TargetRow } from '@/lib/types';
export function TargetsTable({ targets, showCategory = false }: { targets: (TargetRow | CountryTargetRow)[]; showCategory?: boolean }) {
if (!targets.length) return No target anchored in this scope.;
const sorted = [...targets].sort((a, b) => b.pressure - a.pressure);
return (
Target
{showCategory &&
Category
}
Pressure
OK 1h
TTFB p50
{sorted.map((t) => (
{t.name}{t.target_id}
{showCategory &&
{'category' in t ? t.category : '—'}
}
{fmtPct(t.ok_ratio_1h, 1)}
{fmtMs(t.ttfb_ms_median)}
))}
);
}
export function ProbesTable({ probes, compact = false }: { probes: Probe[]; compact?: boolean }) {
if (!probes.length) return No probe in this scope — pressure here is the destination view only.;
return (