diff --git a/components/admin/ChallengeManagement.tsx b/components/admin/ChallengeManagement.tsx index 98542a6..d9717a4 100644 --- a/components/admin/ChallengeManagement.tsx +++ b/components/admin/ChallengeManagement.tsx @@ -9,7 +9,7 @@ import { adminCancelChallenge, reactivateChallenge, } from "@/actions/admin/challenges"; -import { Button, Card, Input, Textarea, Alert } from "@/components/ui"; +import { Button, Card, Input, Textarea, Alert, Modal, CloseButton } from "@/components/ui"; import { Avatar } from "@/components/ui"; interface Challenge { @@ -417,23 +417,29 @@ export default function ChallengeManagement() { {/* Modal de validation */} {selectedChallenge && ( -
{ + { setSelectedChallenge(null); setWinnerId(""); setAdminComment(""); }} + size="lg" > - e.stopPropagation()} - > -
-

+
+
+

Désigner le gagnant

+ { + setSelectedChallenge(null); + setWinnerId(""); + setAdminComment(""); + }} + size="lg" + /> +

@@ -544,31 +550,37 @@ export default function ChallengeManagement() { Annuler

-
- -

+
+ )} {/* Modal d'édition */} {editingChallenge && ( -
{ + { setEditingChallenge(null); setEditTitle(""); setEditDescription(""); setEditPointsReward(0); }} + size="lg" > - e.stopPropagation()} - > -
-

+
+
+

Modifier le défi

+ { + setEditingChallenge(null); + setEditTitle(""); + setEditDescription(""); + setEditPointsReward(0); + }} + size="lg" + /> +
-

-
-
+ + )} ); diff --git a/components/admin/EventManagement.tsx b/components/admin/EventManagement.tsx index 5276322..80e8649 100644 --- a/components/admin/EventManagement.tsx +++ b/components/admin/EventManagement.tsx @@ -3,7 +3,15 @@ import { useState, useEffect, useTransition } from "react"; import { calculateEventStatus } from "@/lib/eventStatus"; import { createEvent, updateEvent, deleteEvent } from "@/actions/admin/events"; -import { Input, Textarea, Button, Card, Badge } from "@/components/ui"; +import { + Input, + Textarea, + Button, + Card, + Badge, + Modal, + CloseButton, +} from "@/components/ui"; interface Event { id: string; @@ -221,116 +229,126 @@ export default function EventManagement() { )} + {/* Modal de création/édition */} {(isCreating || editingEvent) && ( - -

- {isCreating ? "Créer un événement" : "Modifier l'événement"} -

-
- - setFormData({ ...formData, date: e.target.value }) - } - className="text-xs sm:text-sm px-3 py-2" - /> - - setFormData({ ...formData, name: e.target.value }) - } - placeholder="Nom de l'événement" - className="text-xs sm:text-sm px-3 py-2" - /> -