// OVERLAY 07: ПРЕДЫДУЩИЕ ОЦЕНКИ (cache view). // Faithful markup port of МЕРА Оценка.dc.html lines 593-613. // Data via `data` prop (mapCache output); defaults to fixtures (cacheKpi + cacheRows). import { tokens } from "./tokens"; import { cacheKpi, cacheRows } from "./fixtures"; import type { CacheData } from "./mappers"; const FIXTURE_CACHE: CacheData = { kpis: cacheKpi, rows: cacheRows }; export function CacheView({ data = FIXTURE_CACHE }: { data?: CacheData }) { const showSrc = data.rows.some((r) => r.src && r.src !== "—"); const gridCols = showSrc ? "2.4fr 1fr 1fr 1fr" : "2.4fr 1fr 1fr"; return (
{/* 3 KPI cards */}
{data.kpis.map((kpi) => (
{kpi.label}
{kpi.value} {kpi.unit && ( <> {kpi.unit !== "%" && " "} {kpi.unit} )}
{kpi.sub}
))}
{/* Последние оценки table */}
Последние оценки
АДРЕС ВРЕМЯ {showSrc && ИСТОЧНИКОВ} СТАТУС
{data.rows.map((r, i) => (
{r.addr} {r.time} {showSrc && ( {r.src} )} {r.status}
))}
); }