feat: review my team page with importance
This commit is contained in:
@@ -13,6 +13,7 @@ import { Badge } from "@/components/ui/badge";
|
||||
import { TeamMemberProfile, SkillGap } from "@/lib/team-review-types";
|
||||
import { UserCheck, GraduationCap } from "lucide-react";
|
||||
import { TechIcon } from "@/components/icons/tech-icon";
|
||||
import { getImportanceColors } from "@/lib/tech-colors";
|
||||
|
||||
interface SkillMatrixProps {
|
||||
members: TeamMemberProfile[];
|
||||
@@ -106,87 +107,97 @@ export function SkillMatrix({ members, skillGaps }: SkillMatrixProps) {
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{skills.map((skill) => (
|
||||
<TableRow
|
||||
key={`skill-row-${skill.skillId}-${skill.category}`}
|
||||
className="border-white/10"
|
||||
>
|
||||
<TableCell className="font-medium">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-8 h-8 rounded-lg bg-white/10 border border-white/20 flex items-center justify-center">
|
||||
<TechIcon
|
||||
iconName={skill.icon || ""}
|
||||
className="w-4 h-4 text-blue-400"
|
||||
fallbackText={skill.skillName}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-slate-200">
|
||||
{skill.skillName}
|
||||
</span>
|
||||
{skill.risk === "high" && (
|
||||
<Badge
|
||||
variant="destructive"
|
||||
className="bg-red-500/20 text-red-200 border-red-500/30"
|
||||
>
|
||||
Risque
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</TableCell>
|
||||
{members.map((member) => {
|
||||
const memberSkill = member.skills.find(
|
||||
(s) => s.skillId === skill.skillId
|
||||
);
|
||||
return (
|
||||
<TableCell
|
||||
key={`skill-${skill.skillId}-member-${member.member.uuid}`}
|
||||
>
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
{getLevelBadge(memberSkill?.level || null)}
|
||||
{memberSkill?.canMentor && (
|
||||
{skills.map((skill) => {
|
||||
const colors = getImportanceColors(skill.importance);
|
||||
return (
|
||||
<TableRow
|
||||
key={`skill-row-${skill.skillId}-${skill.category}`}
|
||||
className="border-white/10"
|
||||
>
|
||||
<TableCell className="font-medium">
|
||||
<div className="flex items-center gap-3">
|
||||
<div
|
||||
className={`w-8 h-8 rounded-lg ${colors.bg} ${colors.border} border flex items-center justify-center`}
|
||||
>
|
||||
<TechIcon
|
||||
iconName={skill.icon || ""}
|
||||
className={`w-4 h-4 ${colors.text}`}
|
||||
fallbackText={skill.skillName}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className={`${colors.text} font-medium`}>
|
||||
{skill.skillName}
|
||||
</span>
|
||||
{skill.risk === "high" && (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="flex items-center gap-1 bg-green-500/10 text-green-200 border-green-500/30"
|
||||
variant="destructive"
|
||||
className="bg-red-500/20 text-red-200 border-red-500/30 w-fit"
|
||||
>
|
||||
<UserCheck className="h-3 w-3" />
|
||||
<span className="text-xs">Mentor</span>
|
||||
</Badge>
|
||||
)}
|
||||
{memberSkill?.wantsToLearn && (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="flex items-center gap-1 bg-blue-500/10 text-blue-200 border-blue-500/30"
|
||||
>
|
||||
<GraduationCap className="h-3 w-3" />
|
||||
<span className="text-xs">Apprenant</span>
|
||||
Risque
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</TableCell>
|
||||
);
|
||||
})}
|
||||
<TableCell>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="w-full bg-white/10 rounded-full h-2">
|
||||
<div
|
||||
className="bg-blue-500/50 h-2 rounded-full"
|
||||
style={{
|
||||
width: `${Math.max(
|
||||
0,
|
||||
Math.min(100, skill.coverage || 0)
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span className="text-sm text-slate-400 whitespace-nowrap">
|
||||
{Math.round(skill.coverage || 0)}%
|
||||
</span>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableCell>
|
||||
{members.map((member) => {
|
||||
const memberSkill = member.skills.find(
|
||||
(s) => s.skillId === skill.skillId
|
||||
);
|
||||
return (
|
||||
<TableCell
|
||||
key={`skill-${skill.skillId}-member-${member.member.uuid}`}
|
||||
>
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
{getLevelBadge(memberSkill?.level || null)}
|
||||
{memberSkill?.canMentor && (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="flex items-center gap-1 bg-green-500/10 text-green-200 border-green-500/30"
|
||||
>
|
||||
<UserCheck className="h-3 w-3" />
|
||||
<span className="text-xs">Mentor</span>
|
||||
</Badge>
|
||||
)}
|
||||
{memberSkill?.wantsToLearn && (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="flex items-center gap-1 bg-blue-500/10 text-blue-200 border-blue-500/30"
|
||||
>
|
||||
<GraduationCap className="h-3 w-3" />
|
||||
<span className="text-xs">Apprenant</span>
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
</TableCell>
|
||||
);
|
||||
})}
|
||||
<TableCell>
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="w-full bg-white/10 rounded-full h-2">
|
||||
<div
|
||||
className={`h-2 rounded-full ${colors.bg.replace(
|
||||
"/20",
|
||||
"/50"
|
||||
)}`}
|
||||
style={{
|
||||
width: `${Math.max(
|
||||
0,
|
||||
Math.min(100, skill.coverage || 0)
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<span
|
||||
className={`text-sm ${colors.text} whitespace-nowrap`}
|
||||
>
|
||||
{Math.round(skill.coverage || 0)}%
|
||||
</span>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { CategoryCoverage } from "@/lib/team-review-types";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { AlertTriangle, AlertCircle } from "lucide-react";
|
||||
|
||||
interface TeamInsightsProps {
|
||||
recommendations: string[];
|
||||
@@ -22,9 +23,27 @@ export function TeamInsights({
|
||||
<CardContent className="space-y-6">
|
||||
<div className="space-y-4">
|
||||
{recommendations.map((recommendation, index) => (
|
||||
<Alert key={index} className="bg-white/5 border-white/10">
|
||||
<AlertDescription className="text-slate-300">
|
||||
{recommendation}
|
||||
<Alert
|
||||
key={index}
|
||||
className={`${
|
||||
recommendation.includes("⚠️")
|
||||
? "bg-red-500/10 border-red-500/30"
|
||||
: "bg-white/5 border-white/10"
|
||||
}`}
|
||||
>
|
||||
<AlertDescription
|
||||
className={`${
|
||||
recommendation.includes("⚠️")
|
||||
? "text-red-200"
|
||||
: "text-slate-300"
|
||||
} flex items-start gap-2`}
|
||||
>
|
||||
{recommendation.includes("⚠️") ? (
|
||||
<AlertTriangle className="h-5 w-5 text-red-400 shrink-0" />
|
||||
) : (
|
||||
<AlertCircle className="h-5 w-5 text-blue-400 shrink-0" />
|
||||
)}
|
||||
<span>{recommendation.replace("⚠️ ", "")}</span>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
))}
|
||||
@@ -79,6 +98,52 @@ export function TeamInsights({
|
||||
app.
|
||||
</div>
|
||||
</div>
|
||||
{/* Couverture des compétences critiques */}
|
||||
<div className="grid grid-cols-2 gap-2 pt-2">
|
||||
<div className="space-y-1">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-xs text-slate-400">
|
||||
Incontournables
|
||||
</span>
|
||||
<span className="text-xs font-medium text-red-300">
|
||||
{category.criticalSkillsCoverage.incontournable}
|
||||
</span>
|
||||
</div>
|
||||
<div className="h-1 w-full bg-white/10 rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-red-500/50 rounded-full transition-all"
|
||||
style={{
|
||||
width: `${Math.min(
|
||||
100,
|
||||
Math.max(
|
||||
0,
|
||||
category.criticalSkillsCoverage.incontournable
|
||||
)
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-xs text-slate-400">Majeures</span>
|
||||
<span className="text-xs font-medium text-orange-300">
|
||||
{category.criticalSkillsCoverage.majeure}
|
||||
</span>
|
||||
</div>
|
||||
<div className="h-1 w-full bg-white/10 rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-orange-500/50 rounded-full transition-all"
|
||||
style={{
|
||||
width: `${Math.min(
|
||||
100,
|
||||
Math.max(0, category.criticalSkillsCoverage.majeure)
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { TeamReviewData } from "@/lib/team-review-types";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { AlertTriangle } from "lucide-react";
|
||||
import { getImportanceColors } from "@/lib/tech-colors";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
|
||||
interface TeamOverviewProps {
|
||||
team: TeamReviewData["team"];
|
||||
stats: TeamReviewData["stats"];
|
||||
members: TeamReviewData["members"];
|
||||
categoryCoverage: TeamReviewData["categoryCoverage"];
|
||||
skillGaps: TeamReviewData["skillGaps"];
|
||||
}
|
||||
|
||||
export function TeamOverview({
|
||||
@@ -16,6 +25,7 @@ export function TeamOverview({
|
||||
stats,
|
||||
members,
|
||||
categoryCoverage,
|
||||
skillGaps,
|
||||
}: TeamOverviewProps) {
|
||||
// Trouver les top contributeurs
|
||||
const topContributors = [...members]
|
||||
@@ -29,24 +39,51 @@ export function TeamOverview({
|
||||
|
||||
// Trouver les catégories qui nécessitent de l'attention
|
||||
const categoriesNeedingAttention = [...categoryCoverage]
|
||||
.filter((cat) => {
|
||||
// Une catégorie nécessite de l'attention si :
|
||||
// - Couverture faible (< 40%)
|
||||
// - OU pas assez d'experts (< 2) avec une équipe de taille significative (> 5)
|
||||
// - OU beaucoup d'apprenants (> 30% de l'équipe) avec peu de mentors (< 2)
|
||||
return (
|
||||
cat.coverage < 40 ||
|
||||
(cat.experts < 2 && stats.totalMembers > 5) ||
|
||||
(cat.learners > stats.totalMembers * 0.3 && cat.mentors < 2)
|
||||
.map((cat) => {
|
||||
// Pour chaque catégorie, on identifie :
|
||||
// 1. Les compétences incontournables sous-couvertes (< 75%)
|
||||
const uncoveredIncontournables = skillGaps.filter(
|
||||
(gap) =>
|
||||
gap.category === cat.category &&
|
||||
gap.importance === "incontournable" &&
|
||||
gap.coverage < 75
|
||||
);
|
||||
|
||||
// 2. Les compétences majeures sous-couvertes (< 60%)
|
||||
const uncoveredMajeures = skillGaps.filter(
|
||||
(gap) =>
|
||||
gap.category === cat.category &&
|
||||
gap.importance === "majeure" &&
|
||||
gap.coverage < 60
|
||||
);
|
||||
|
||||
// Une catégorie nécessite de l'attention si :
|
||||
const needsAttention =
|
||||
uncoveredIncontournables.length > 0 || // Il y a des compétences incontournables sous-couvertes
|
||||
uncoveredMajeures.length > 0 || // OU des compétences majeures sous-couvertes
|
||||
(cat.experts < 2 && stats.totalMembers > 5); // OU pas assez d'experts dans une équipe significative
|
||||
|
||||
if (!needsAttention) return null;
|
||||
|
||||
// Calculer un score d'attention pour trier les catégories
|
||||
const attentionScore =
|
||||
// Les incontournables pèsent plus lourd
|
||||
uncoveredIncontournables.length * 3 +
|
||||
// Les majeures un peu moins
|
||||
uncoveredMajeures.length * 2 +
|
||||
// Manque d'experts est un facteur aggravant
|
||||
(cat.experts < 2 && stats.totalMembers > 5 ? 1 : 0);
|
||||
|
||||
return {
|
||||
...cat,
|
||||
// On combine les deux types pour l'affichage
|
||||
criticalSkills: [...uncoveredIncontournables, ...uncoveredMajeures],
|
||||
attentionScore,
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
// Prioriser les catégories avec le plus de besoins
|
||||
const aScore = a.learners * 2 - a.mentors - a.experts;
|
||||
const bScore = b.learners * 2 - b.mentors - b.experts;
|
||||
return bScore - aScore;
|
||||
})
|
||||
.slice(0, 2);
|
||||
.filter(Boolean)
|
||||
.sort((a, b) => b.attentionScore - a.attentionScore)
|
||||
.slice(0, 3);
|
||||
|
||||
return (
|
||||
<Card className="bg-white/5 border-white/10 backdrop-blur">
|
||||
@@ -130,23 +167,76 @@ export function TeamOverview({
|
||||
variant="outline"
|
||||
className="text-amber-400 border-amber-400/30"
|
||||
>
|
||||
{cat.learners} apprenants
|
||||
{cat.experts} exp • {cat.mentors} ment
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-4 text-sm text-slate-400">
|
||||
<span>{cat.experts} experts</span>
|
||||
<span>{cat.mentors} mentors</span>
|
||||
</div>
|
||||
<div className="text-xs text-amber-400/80">
|
||||
{cat.coverage < 40 && "Couverture insuffisante • "}
|
||||
{cat.experts < 2 &&
|
||||
stats.totalMembers > 5 &&
|
||||
"Manque d'experts • "}
|
||||
{cat.learners > stats.totalMembers * 0.3 &&
|
||||
cat.mentors < 2 &&
|
||||
"Besoin de mentors"}
|
||||
</div>
|
||||
{/* Compétences sous-couvertes */}
|
||||
{cat.criticalSkills.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{cat.criticalSkills
|
||||
.sort((a, b) => {
|
||||
if (
|
||||
a.importance === "incontournable" &&
|
||||
b.importance !== "incontournable"
|
||||
)
|
||||
return -1;
|
||||
if (
|
||||
a.importance !== "incontournable" &&
|
||||
b.importance === "incontournable"
|
||||
)
|
||||
return 1;
|
||||
return a.coverage - b.coverage;
|
||||
})
|
||||
.map((skill) => {
|
||||
const colors = getImportanceColors(skill.importance);
|
||||
const target =
|
||||
skill.importance === "incontournable" ? 75 : 60;
|
||||
return (
|
||||
<Tooltip key={skill.skillId}>
|
||||
<TooltipTrigger>
|
||||
<div
|
||||
className={`text-xs rounded-md px-1.5 py-0.5 ${colors.bg} ${colors.border} border flex items-center gap-1.5`}
|
||||
>
|
||||
<span className={colors.text}>
|
||||
{skill.skillName}
|
||||
</span>
|
||||
<span
|
||||
className={
|
||||
skill.coverage < target
|
||||
? "text-red-400"
|
||||
: "text-slate-400"
|
||||
}
|
||||
>
|
||||
{skill.coverage.toFixed(0)}%
|
||||
</span>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="bg-slate-900 text-slate-200 border border-slate-700">
|
||||
<div className="text-xs">
|
||||
<p className="font-medium">
|
||||
{skill.importance === "incontournable"
|
||||
? "Compétence incontournable"
|
||||
: "Compétence majeure"}
|
||||
</p>
|
||||
<p className="text-slate-400">
|
||||
Objectif : {target}% de couverture
|
||||
<br />
|
||||
Actuel : {skill.coverage.toFixed(0)}%
|
||||
<br />
|
||||
{skill.coverage < target
|
||||
? `Manque ${(
|
||||
target - skill.coverage
|
||||
).toFixed(0)}%`
|
||||
: "Objectif atteint"}
|
||||
</p>
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
{stats.learningNeeds > 0 && (
|
||||
|
||||
@@ -13,7 +13,13 @@ import {
|
||||
PieChart,
|
||||
Pie,
|
||||
Cell,
|
||||
Legend,
|
||||
} from "recharts";
|
||||
import {
|
||||
Tooltip as UITooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
|
||||
interface TeamStatsProps {
|
||||
stats: TeamReviewData["stats"];
|
||||
@@ -73,20 +79,45 @@ export function TeamStats({
|
||||
const learnerCount = members.filter((m) => m.learningSkills > 0).length;
|
||||
const mentorshipRatio = (mentorCount / (stats.totalMembers || 1)) * 100;
|
||||
|
||||
// Gaps critiques par catégorie
|
||||
const criticalGapsByCategory = skillGaps
|
||||
.filter((gap) => gap.risk === "high")
|
||||
.reduce((acc, gap) => {
|
||||
acc[gap.category] = (acc[gap.category] || 0) + 1;
|
||||
return acc;
|
||||
}, {} as Record<string, number>);
|
||||
// Gaps critiques par catégorie, séparés par importance
|
||||
const criticalGapsByCategory = skillGaps.reduce((acc, gap) => {
|
||||
const isIncontournableUndercovered =
|
||||
gap.importance === "incontournable" && gap.coverage < 75;
|
||||
const isMajeureUndercovered =
|
||||
gap.importance === "majeure" && gap.coverage < 60;
|
||||
|
||||
const gapData = Object.entries(criticalGapsByCategory).map(
|
||||
([category, count]) => ({
|
||||
if (isIncontournableUndercovered || isMajeureUndercovered) {
|
||||
if (!acc[gap.category]) {
|
||||
acc[gap.category] = { incontournable: 0, majeure: 0 };
|
||||
}
|
||||
if (isIncontournableUndercovered) {
|
||||
acc[gap.category].incontournable++;
|
||||
}
|
||||
if (isMajeureUndercovered) {
|
||||
acc[gap.category].majeure++;
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, {} as Record<string, { incontournable: number; majeure: number }>);
|
||||
|
||||
const gapData = Object.entries(criticalGapsByCategory)
|
||||
.map(([category, counts]) => ({
|
||||
name: category,
|
||||
value: count,
|
||||
fill: "#ef4444",
|
||||
})
|
||||
incontournable: counts.incontournable,
|
||||
majeure: counts.majeure,
|
||||
}))
|
||||
.sort(
|
||||
(a, b) =>
|
||||
// Trier d'abord par nombre total de compétences critiques
|
||||
b.incontournable + b.majeure - (a.incontournable + a.majeure) ||
|
||||
// Puis par nombre de compétences incontournables
|
||||
b.incontournable - a.incontournable
|
||||
);
|
||||
|
||||
// Nombre total de compétences critiques sous-couvertes
|
||||
const totalCriticalGaps = Object.values(criticalGapsByCategory).reduce(
|
||||
(sum, counts) => sum + counts.incontournable + counts.majeure,
|
||||
0
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -117,11 +148,96 @@ export function TeamStats({
|
||||
{mentorshipRatio.toFixed(0)}%
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm text-slate-400">Gaps critiques</p>
|
||||
<p className="text-2xl font-bold text-red-400">
|
||||
{stats.learningNeeds}
|
||||
</p>
|
||||
<UITooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm text-slate-400">Compétences critiques</p>
|
||||
<p className="text-2xl font-bold text-red-400">
|
||||
{totalCriticalGaps}
|
||||
</p>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="bg-slate-900 text-slate-200 border border-slate-700">
|
||||
<div className="text-xs space-y-1">
|
||||
<p>Compétences critiques sous-couvertes :</p>
|
||||
<ul className="list-disc list-inside space-y-0.5">
|
||||
<li>Incontournables : couverture < 75%</li>
|
||||
<li>Majeures : couverture < 60%</li>
|
||||
</ul>
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</UITooltip>
|
||||
</div>
|
||||
|
||||
{/* Couverture des compétences critiques */}
|
||||
<div>
|
||||
<h3 className="text-sm font-medium text-slate-200 mb-4">
|
||||
Couverture des compétences critiques
|
||||
</h3>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<UITooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-slate-400">
|
||||
Incontournables
|
||||
</span>
|
||||
<span className="text-sm font-medium text-slate-200">
|
||||
{stats.criticalSkillsCoverage.incontournable.toFixed(0)}%
|
||||
</span>
|
||||
</div>
|
||||
<div className="h-2 w-full bg-white/10 rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-red-500/50 rounded-full transition-all"
|
||||
style={{
|
||||
width: `${Math.min(
|
||||
100,
|
||||
Math.max(
|
||||
0,
|
||||
stats.criticalSkillsCoverage.incontournable
|
||||
)
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="bg-slate-900 text-slate-200 border border-slate-700">
|
||||
<div className="text-xs">
|
||||
<p>Compétences incontournables</p>
|
||||
<p className="text-slate-400">Objectif : 75% de couverture</p>
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</UITooltip>
|
||||
<UITooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-slate-400">Majeures</span>
|
||||
<span className="text-sm font-medium text-slate-200">
|
||||
{stats.criticalSkillsCoverage.majeure.toFixed(0)}%
|
||||
</span>
|
||||
</div>
|
||||
<div className="h-2 w-full bg-white/10 rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-orange-500/50 rounded-full transition-all"
|
||||
style={{
|
||||
width: `${Math.min(
|
||||
100,
|
||||
Math.max(0, stats.criticalSkillsCoverage.majeure)
|
||||
)}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="bg-slate-900 text-slate-200 border border-slate-700">
|
||||
<div className="text-xs">
|
||||
<p>Compétences majeures</p>
|
||||
<p className="text-slate-400">Objectif : 60% de couverture</p>
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</UITooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -198,9 +314,9 @@ export function TeamStats({
|
||||
{gapData.length > 0 && (
|
||||
<div>
|
||||
<h3 className="text-sm font-medium text-slate-200 mb-4">
|
||||
Gaps critiques par catégorie
|
||||
Compétences critiques sous-couvertes par catégorie
|
||||
</h3>
|
||||
<div className="h-[200px]">
|
||||
<div className="h-[250px]">
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<BarChart data={gapData}>
|
||||
<CartesianGrid
|
||||
@@ -224,8 +340,36 @@ export function TeamStats({
|
||||
}}
|
||||
itemStyle={{ color: "#e2e8f0" }}
|
||||
labelStyle={{ color: "#e2e8f0" }}
|
||||
formatter={(value, name) => {
|
||||
const label =
|
||||
name === "incontournable"
|
||||
? "Incontournables (obj. 75%)"
|
||||
: "Majeures (obj. 60%)";
|
||||
return [value, label];
|
||||
}}
|
||||
/>
|
||||
<Legend
|
||||
formatter={(value) => {
|
||||
return value === "incontournable"
|
||||
? "Incontournables (obj. 75%)"
|
||||
: "Majeures (obj. 60%)";
|
||||
}}
|
||||
wrapperStyle={{
|
||||
paddingTop: "20px",
|
||||
}}
|
||||
/>
|
||||
<Bar
|
||||
dataKey="incontournable"
|
||||
fill="#ef4444"
|
||||
name="incontournable"
|
||||
stackId="stack"
|
||||
/>
|
||||
<Bar
|
||||
dataKey="majeure"
|
||||
fill="#f97316"
|
||||
name="majeure"
|
||||
stackId="stack"
|
||||
/>
|
||||
<Bar dataKey="value" />
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user