import React from 'react'; interface PerformanceBarProps { score: number; // 0-100 passingPercentage: number; // e.g., 70 } export default function PerformanceBar({ score, passingPercentage }: PerformanceBarProps) { // Calculate tier boundaries // Reprobado: 0 to P-1 const reprobadoMax = Math.max(0, passingPercentage - 1); // Rendimiento Bajo: P to P+9 const lowMin = passingPercentage; const lowMax = passingPercentage + 9; // Rendimiento Medio: P+10 to P+15 const mediumMin = passingPercentage + 10; const mediumMax = passingPercentage + 15; // Buen Rendimiento: P+16 to 90 const goodMin = passingPercentage + 16; const goodMax = 90; // Excelente: 91+ const excellentMin = 91; // Determine current tier let tier = ''; let tierColor = ''; let tierLabel = ''; if (score < passingPercentage) { tier = 'reprobado'; tierColor = 'bg-red-500'; tierLabel = 'Reprobado'; } else if (score >= lowMin && score <= lowMax) { tier = 'low'; tierColor = 'bg-orange-500'; tierLabel = 'Rendimiento Bajo'; } else if (score >= mediumMin && score <= mediumMax) { tier = 'medium'; tierColor = 'bg-yellow-500'; tierLabel = 'Rendimiento Medio'; } else if (score >= goodMin && score <= goodMax) { tier = 'good'; tierColor = 'bg-green-500'; tierLabel = 'Buen Rendimiento'; } else if (score >= excellentMin) { tier = 'excellent'; tierColor = 'bg-blue-500'; tierLabel = 'Excelente'; } return (