/** * WalletChart — live wallet balance history for both agents */ import { AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, ReferenceLine, Legend, } from "recharts"; import { TooltipPanel } from "./Panel"; interface WalletPoint { game: number; white: number; black: number; } interface WalletChartProps { history: WalletPoint[]; } const CustomTooltip = ({ active, payload, label }: any) => { if (!active || !payload?.length) return null; return (
Game #{label}
{payload.map((p: any) => (
{p.name}: {typeof p.value === "number" ? p.value.toFixed(1) : p.value} units
))}
); }; export default function WalletChart({ history }: WalletChartProps) { if (history.length < 2) { return (
Collecting wallet data...
); } return ( } /> ); }