import React from 'react'; import { cn } from '@/lib/utils'; const TIERS = [ { label: 'Top Talent', range: '80-100', color: 'bg-[#1E3A8A]', textColor: 'text-[#1E3A8A]' }, { label: 'Strong Fit', range: '60-79', color: 'bg-[#60A5FA]', textColor: 'text-[#2563EB]' }, { label: 'Possible Fit', range: '40-59', color: 'bg-[#93C5FD]', textColor: 'text-[#3B82F6]' }, { label: 'Not a Fit', range: '0-39', color: 'bg-[#E5E7EB]', textColor: 'text-[#9CA3AF]' }, ]; function getTier(score) { if (score >= 80) return 0; if (score >= 60) return 1; if (score >= 40) return 2; return 3; } export default function KROWCandidateLeaderboard({ applications, maxBars = 4 }) { const screened = applications.filter(a => a.ai_score > 0 || a.status !== 'applied'); const counts = TIERS.map((_, i) => screened.filter(a => getTier(a.ai_score || 0) === i).length); const total = counts.reduce((a, b) => a + b, 0) || 1; const sorted = [...screened].sort((a, b) => (b.ai_score || 0) - (a.ai_score || 0)); return (