feat(routing): redesign node cards to the System Sheet recipe (#1133)

Lift <RoutingNodeCard> primitive from audit §21 / DESIGN §9.13. Migrate
the fleet adapter to consume it: collapse five inline state pills into
a single nodeState prop, replace the k/v stat list with a mono meta
line, drop the per-row HEALTHY chip in favor of a state dot, and add a
real empty-state block with a primary CTA for every state. Compact
density body swap stays inside the component, no -compact fork.
This commit is contained in:
Anso
2026-05-21 10:18:03 -04:00
committed by GitHub
parent 620e28f352
commit cdb9cd414e
4 changed files with 741 additions and 160 deletions
+15
View File
@@ -18,3 +18,18 @@ export function formatTimeAgo(timestamp: number): string {
if (hrs < 24) return `${hrs}h ago`;
return `${Math.floor(hrs / 24)}d ago`;
}
/**
* Short age formatter for cockpit-style "12s / 4m / 3h / 2d" badges. Always
* returns under five characters. Negative deltas (clock skew) read as `0s`.
*/
export function formatAgeShort(ms: number): string {
if (ms < 1000) return '0s';
const s = Math.floor(ms / 1000);
if (s < 60) return `${s}s`;
const m = Math.floor(s / 60);
if (m < 60) return `${m}m`;
const h = Math.floor(m / 60);
if (h < 24) return `${h}h`;
return `${Math.floor(h / 24)}d`;
}