import { Trophy, AlertTriangle } from 'lucide-react';
import type { ScoreBreakdown } from '@/types';
import { cn, formatScore, formatReward } from '@/lib/utils';
interface ScorePanelProps {
scores: ScoreBreakdown | null;
done: boolean;
className?: string;
}
export default function ScorePanel({ scores, done, className }: ScorePanelProps) {
return (
Scores
{done && (
Final
)}
{!scores ? (
{done ? 'No scores available' : 'Scores appear after episode ends'}
) : (
Total Reward
{formatReward(scores.total_reward)}
+{formatReward(scores.efficiency_bonus)} eff
+{formatReward(scores.communication_bonus)} comm
{scores.penalties > 0 && -{formatReward(scores.penalties)} pen}
{scores.penalty_reasons.length > 0 && (
{scores.penalty_reasons.map((r, i) => - • {r}
)}
)}
)}
);
}
function ScoreBar({ label, value, color }: { label: string; value: number; color: string }) {
return (
{label}
{formatScore(value)}
);
}