import { cn } from '@/lib/utils'; interface ScoreBarProps { label: string; score: number; className?: string; } export function ScoreBar({ label, score, className }: ScoreBarProps) { const clipped = Math.min(100, Math.max(0, score)); const color = clipped >= 80 ? 'bg-green-500' : clipped >= 60 ? 'bg-yellow-500' : 'bg-red-500'; const verdict = clipped >= 80 ? '优秀' : clipped >= 60 ? '需改进' : '不合格'; return (
{label} {clipped} ({verdict})
); }