fix: update delete button behavior in TreeCategoryHeader and TeamsList

- Removed unnecessary canDelete prop from TreeCategoryHeader's delete button condition.
- Added disabled state to the delete button based on canDelete logic.
- Updated canDelete prop in TeamsList to reflect whether the direction has members.
This commit is contained in:
Julien Froidefond
2025-08-25 22:00:40 +02:00
parent 3b8f3e4110
commit e8138ebcb3
2 changed files with 8 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ export function TeamsList({
itemLabel="équipe"
showSeparator={index > 0}
onDelete={() => onDeleteDirection(direction)}
canDelete={true}
canDelete={!getDirectionStats(direction).hasMembers}
isDirection={true}
directionStats={getDirectionStats(direction)}
/>