+ {etapes.map((etape, index) => {
+ const childTasks = tabloTasks.filter((t) => t.parent_task_id === etape.id);
+ const doneCount = childTasks.filter((t) => t.status === "done").length;
+ const totalCount = childTasks.length;
+ const progressPct = totalCount > 0 ? Math.round((doneCount / totalCount) * 100) : 0;
+ const isExpanded = expandedEtapes.has(etape.id);
+ const status = statusConfig[etape.status] ?? statusConfig.todo;
+
+ return (
+
+ {/* Etape header */}
+
+
+ {/* Child tasks */}
+ {isExpanded && childTasks.length > 0 && (
+
+ {childTasks.map((task) => (
+
+ {task.status === "done" ? (
+
+ ) : (
+
+ )}
+
+ {task.title}
+
+ {task.status && (
+
+ {(statusConfig[task.status] ?? statusConfig.todo).label}
+
+ )}
+
+ ))}
+
+ )}
+
+ {isExpanded && childTasks.length === 0 && (
+
+ Aucune tâche dans cette étape
+
+ )}
+
+ );
+ })}
+
+ );
+}