import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell } from 'recharts' import type { SimResult } from '../types' interface Props { result: SimResult currentStepIndex: number } export function ScorePanel({ result, currentStepIndex }: Props) { const progress = result.steps.length > 0 ? (currentStepIndex + 1) / result.steps.length : 1 const cumulativeReward = result.steps .slice(0, currentStepIndex + 1) .reduce((sum, s) => sum + s.reward, 0) const displayScore = result.final_score != null ? (currentStepIndex >= result.steps.length - 1 ? result.final_score : null) : null const scoreColor = displayScore == null ? 'text-zinc-400' : displayScore >= 0.6 ? 'text-green-400' : displayScore >= 0.35 ? 'text-orange-400' : 'text-red-400' const rewardData = result.steps.slice(0, currentStepIndex + 1).map((s) => ({ step: s.step, reward: parseFloat(s.reward.toFixed(3)), })) return (