// Replay Snapshot Health // Purpose: Defines the Replay Snapshot Health module and the local helpers/components used in this file. // Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit. import { roverNameChromeStyle } from '../../lib/roverColor.js'; export default function ReplaySnapshotHealth({ health, roster = [] }) { if (!health) return null; const replay = health.replay || { sources: [], readyCount: 0, totalCount: 0 }; const snapshots = health.snapshots || { rovers: [], rooms: [] }; const roverColorFor = (id) => roster.find((entry) => String(entry.id) === String(id))?.color || null; const replaySummary = `${replay.readyCount}/${replay.totalCount} sources ready`; const roverStale = snapshots.rovers.filter((entry) => entry.stale).length; const roomStale = snapshots.rooms.filter((entry) => entry.stale).length; return (