import { fmt, fmtSigned } from '../utils/format.js'; function Stat({ label, value, delta, deltaDir, hint }) { return (
{label} {value} {delta !== undefined && delta !== null && ( {delta} )} {hint && {hint}}
); } function deltaArrow(curr, prev) { if (prev === undefined || prev === null) return { delta: undefined }; const d = curr - prev; if (Math.abs(d) < 1e-6) return { delta: '·', dir: '' }; return { delta: fmtSigned(d, Math.abs(d) < 1 ? 3 : 1), dir: d > 0 ? 'up' : 'down' }; } export default function RoundOverview({ round, prevRound, summary }) { if (!round) return null; const treasuryDelta = deltaArrow(round.treasury_after, prevRound?.treasury_after); const prodDelta = deltaArrow(round.productivity, prevRound?.productivity); const popDelta = deltaArrow(round.population, prevRound?.population); const revDelta = deltaArrow(round.total_revenue, prevRound?.total_revenue); const treasuryHint = round.is_critical_failure ? 'frozen — failure before debit' : undefined; return (

Round {round.round_num} Y{round.year} · Q{round.quarter}

Cumulative reward (so far)
{fmtSigned(round.cumulative_reward, 1)}
{round.done && summary && ( <>
Final prosperity
{(summary.final_prosperity * 1000).toFixed(3)} /1k
Termination
{summary.termination_reason}
)}
); }