'use client'; import { AssigneeWorkload, StatusDistribution } from '@/lib/types'; interface TeamActivityHeatmapProps { workloadByAssignee: AssigneeWorkload[]; statusDistribution: StatusDistribution[]; className?: string; } export function TeamActivityHeatmap({ workloadByAssignee, statusDistribution, className }: TeamActivityHeatmapProps) { // Calculer l'intensité maximale pour la normalisation const maxWorkload = Math.max(...workloadByAssignee.map(a => a.totalActive)); // Fonction pour calculer l'intensité de couleur const getIntensity = (value: number) => { if (maxWorkload === 0) return 0; return (value / maxWorkload) * 100; }; // Couleurs pour les différents types de travail const getWorkloadColor = (todo: number, inProgress: number, review: number) => { const total = todo + inProgress + review; if (total === 0) return 'bg-[var(--muted)]/20'; // Dominante par type de travail if (review > inProgress && review > todo) { return 'bg-purple-500'; // Review dominant } else if (inProgress > todo) { return 'bg-orange-500'; // In Progress dominant } else { return 'bg-blue-500'; // Todo dominant } }; const getOpacity = (total: number) => { const intensity = getIntensity(total); return Math.max(0.2, intensity / 100); }; return (