"use client"; import { TrendingUp, MessageSquare, Lightbulb } from "lucide-react"; import { COVERAGE_OBJECTIVES, isCoverageBelowObjective, } from "@/lib/evaluation-utils"; interface SkillAnalysis { skillName: string; category: string; importance: "incontournable" | "majeure" | "standard"; experts: Array<{ name: string; level: number; canMentor: boolean; }>; learners: Array<{ name: string; currentLevel: number; }>; averageLevel: number; totalEvaluations: number; expertCount: number; learnerCount: number; proficiencyRate: number; coverage: number; } interface TeamInsights { averageTeamLevel: number; totalExperts: number; totalLearners: number; skillGaps: { incontournable: number; majeure: number; standard: number; }; strongSkills: { incontournable: number; majeure: number; standard: number; }; criticalSkillsCoverage: { incontournable: number; majeure: number; }; } interface TeamInsightsTabProps { skillAnalysis: SkillAnalysis[]; teamInsights: TeamInsights; } export function TeamInsightsTab({ skillAnalysis, teamInsights, }: TeamInsightsTabProps) { return ( <>
{teamInsights.skillGaps.incontournable > 0 ? ( <> Priorité: combler les lacunes sur{" "} {teamInsights.skillGaps.incontournable} compétence {teamInsights.skillGaps.incontournable > 1 ? "s" : ""}{" "} incontournable {teamInsights.skillGaps.incontournable > 1 ? "s" : ""} sous l'objectif de {COVERAGE_OBJECTIVES.incontournable}%. > ) : ( <> Excellent ! Toutes les compétences incontournables atteignent leur objectif de couverture. > )}
{teamInsights.skillGaps.majeure > 0 ? ( <> Attention: {teamInsights.skillGaps.majeure} compétence {teamInsights.skillGaps.majeure > 1 ? "s" : ""} majeure {teamInsights.skillGaps.majeure > 1 ? "s" : ""} n'atteigne {teamInsights.skillGaps.majeure > 1 ? "nt" : ""} pas l'objectif de {COVERAGE_OBJECTIVES.majeure}%. > ) : ( <> Bravo ! Toutes les compétences majeures atteignent leur objectif de couverture. > )}
{skillAnalysis.filter( (s) => s.experts.filter((e) => e.canMentor).length > 0 && s.learnerCount > 0 && (s.importance === "incontournable" || s.importance === "majeure") ).length > 0 ? ( <> { skillAnalysis.filter( (s) => s.experts.filter((e) => e.canMentor).length > 0 && s.learnerCount > 0 && (s.importance === "incontournable" || s.importance === "majeure") ).length }{" "} opportunité {skillAnalysis.filter( (s) => s.experts.filter((e) => e.canMentor).length > 0 && s.learnerCount > 0 && (s.importance === "incontournable" || s.importance === "majeure") ).length > 1 ? "s" : ""}{" "} de mentorat sur des compétences critiques. > ) : ( <> Aucune opportunité de mentorat identifiée sur les compétences critiques. > )}
Incontournables:{" "} {teamInsights.criticalSkillsCoverage.incontournable.toFixed(0)}% {" • "} Majeures: {teamInsights.criticalSkillsCoverage.majeure.toFixed(0)} %