/**
 * HealthLegend - Color scale legend for health scores
 * 
 * Shows the color-to-health-score mapping for the heatmap.
 */

export default function HealthLegend() {
    const legendItems = [
        { range: '90-100', label: 'Excellent', color: 'bg-emerald-600' },
        { range: '70-89', label: 'Good', color: 'bg-emerald-500' },
        { range: '50-69', label: 'Fair', color: 'bg-yellow-500' },
        { range: '30-49', label: 'Needs Attention', color: 'bg-orange-500' },
        { range: '0-29', label: 'Critical', color: 'bg-red-600' },
    ];

    return (
        <div className="bg-white dark:bg-slate-800 rounded-lg shadow p-4">
            <h3 className="text-sm font-semibold text-slate-700 dark:text-slate-300 mb-3">
                Health Score Legend
            </h3>
            <div className="flex flex-wrap gap-3">
                {legendItems.map(item => (
                    <div key={item.range} className="flex items-center gap-2">
                        <div className={`w-6 h-6 rounded ${item.color}`} />
                        <div className="text-xs">
                            <div className="font-medium text-slate-900 dark:text-white">
                                {item.range}
                            </div>
                            <div className="text-slate-600 dark:text-slate-400">
                                {item.label}
                            </div>
                        </div>
                    </div>
                ))}
            </div>
        </div>
    );
}
