feat: total members on direction line manage

This commit is contained in:
Julien Froidefond
2025-08-25 21:57:18 +02:00
parent 565fde2808
commit 3b8f3e4110
4 changed files with 42 additions and 0 deletions

View File

@@ -15,6 +15,11 @@ interface TreeCategoryHeaderProps {
onDelete?: () => void;
canDelete?: boolean;
isDirection?: boolean; // Pour différencier les directions des catégories de skills
directionStats?: {
direction: string;
totalMembers: number;
hasMembers: boolean;
};
}
export function TreeCategoryHeader({
@@ -28,6 +33,7 @@ export function TreeCategoryHeader({
onDelete,
canDelete = true,
isDirection = false,
directionStats,
}: TreeCategoryHeaderProps) {
return (
<div>
@@ -47,6 +53,15 @@ export function TreeCategoryHeader({
{icon}
<h3 className="text-base font-semibold text-white">{category}</h3>
<div className="flex items-center gap-2 ml-auto">
{isDirection && directionStats && directionStats.hasMembers && (
<Badge
variant="secondary"
className="text-xs px-2 py-0.5 bg-blue-500/20 text-blue-300 border-blue-500/30"
>
{directionStats.totalMembers} membre
{directionStats.totalMembers > 1 ? "s" : ""}
</Badge>
)}
<Badge variant="outline" className="text-xs px-2 py-0.5">
{itemCount} {itemLabel}
{itemCount > 1 ? "s" : ""}