import { AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid } from 'recharts' import type { SimStep } from '../types' interface Props { steps: SimStep[] currentStepIndex: number } export function ScoreGraph({ steps, currentStepIndex }: Props) { if (!steps || steps.length === 0) return null // Generate data points up to the currentStepIndex let cumulative = 0 const data = steps.map((s, i) => { cumulative += s.reward return { step: s.step, reward: s.reward, cumulative: cumulative, isActive: i === currentStepIndex } }) // We show all steps in the whole sequence so the x-axis scale remains stable // But maybe we only draw up to the current step? Recharts handles this if we just pass the full data // and color the rest differently, but slicing is easier to see the progression! const visibleData = data.slice(0, currentStepIndex + 1) return (