import React from 'react'; const PRIORITY_CONFIG = { 5: { color: '#ef4444', label: 'CRITICAL' }, 4: { color: '#f59e0b', label: 'HIGH' }, 3: { color: '#eab308', label: 'MEDIUM' }, 2: { color: '#22c55e', label: 'LOW' }, 1: { color: '#94a3b8', label: 'MINIMAL' }, }; function ScoreGauge({ score }) { const pct = Math.max(0, Math.min(1, score)); const color = pct >= 0.75 ? '#22c55e' : pct >= 0.5 ? '#f59e0b' : pct >= 0.25 ? '#f97316' : '#ef4444'; const size = 100; const stroke = 8; const r = (size - stroke * 2) / 2; const circ = 2 * Math.PI * r; const dash = circ * pct; return (
{(score * 100).toFixed(0)} / 100
); } export default function ScorePanel({ goals, score, done, totalReward, currentStep, maxSteps }) { const completedGoals = goals.filter(g => g.completed); const completionPct = goals.length > 0 ? (completedGoals.length / goals.length) * 100 : 0; return (
🎯 Goals & Score
{/* Score gauge */}
{done ? 'FINAL SCORE' : 'LIVE SCORE'}
{completedGoals.length}/{goals.length} goals done
= 75 ? '#22c55e' : completionPct >= 50 ? '#f59e0b' : '#ef4444' }} />
{completionPct.toFixed(0)}%
{/* Goal checklist */}
OBJECTIVES
{goals.map(goal => { const cfg = PRIORITY_CONFIG[goal.priority] || PRIORITY_CONFIG[1]; return (
{goal.completed && }
{goal.description} P{goal.priority} • {cfg.label}
); })}
{done && (
= 0.7 ? 'rgba(34,197,94,0.1)' : score >= 0.4 ? 'rgba(245,158,11,0.1)' : 'rgba(239,68,68,0.1)', borderColor: score >= 0.7 ? '#22c55e' : score >= 0.4 ? '#f59e0b' : '#ef4444', }}>
{score >= 0.8 ? '🏆 Excellent' : score >= 0.6 ? '✅ Good' : score >= 0.4 ? '⚠️ Adequate' : '❌ Poor'}
= 0.7 ? '#22c55e' : score >= 0.4 ? '#f59e0b' : '#ef4444' }}> {score.toFixed(4)}
)}
); }