feat: add team members functionality and modal

- Introduced `onViewMembers` prop in `TreeItemRow` to handle viewing team members.
- Added `TeamMembersModal` to display members of a selected team.
- Implemented state management for team members in `TeamsManagement`, including fetching and updating stats.
- Enhanced `AdminManagementService` with methods to fetch and remove team members.
This commit is contained in:
Julien Froidefond
2025-08-22 09:28:52 +02:00
parent 7ad970c73c
commit c0e2b9533b
5 changed files with 445 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Edit, Trash2 } from "lucide-react";
import { Edit, Trash2, Users } from "lucide-react";
interface TreeItemRowProps {
icon?: React.ReactNode;
@@ -15,9 +15,11 @@ interface TreeItemRowProps {
}>;
onEdit?: () => void;
onDelete?: () => void;
onViewMembers?: () => void;
canDelete?: boolean;
showSeparator?: boolean;
additionalInfo?: React.ReactNode;
hasMembers?: boolean;
}
export function TreeItemRow({
@@ -27,9 +29,11 @@ export function TreeItemRow({
badges = [],
onEdit,
onDelete,
onViewMembers,
canDelete = true,
showSeparator = false,
additionalInfo,
hasMembers = false,
}: TreeItemRowProps) {
return (
<div>
@@ -67,6 +71,17 @@ export function TreeItemRow({
{/* Actions */}
<div className="flex items-center gap-1 shrink-0">
{onViewMembers && hasMembers && (
<Button
variant="ghost"
size="sm"
onClick={onViewMembers}
className="text-green-400 hover:text-green-300 hover:bg-green-500/20 h-6 w-6 p-0"
title="Voir les membres"
>
<Users className="w-3 h-3" />
</Button>
)}
{onEdit && (
<Button
variant="ghost"