Refactor management components to remove loading state: Eliminate unused loading state and related conditional rendering from ChallengeManagement, EventManagement, FeedbackManagement, HouseManagement, and UserManagement components, simplifying the code and improving readability.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m43s

This commit is contained in:
Julien Froidefond
2025-12-22 08:56:37 +01:00
parent 9bcafe54d3
commit 0c47bf916c
6 changed files with 6 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
"use client";
import { useEffect, useState, useTransition } from "react";
import { useState, useTransition } from "react";
import {
validateChallenge,
rejectChallenge,
@@ -48,7 +48,6 @@ interface ChallengeManagementProps {
export default function ChallengeManagement({ initialChallenges }: ChallengeManagementProps) {
const [challenges, setChallenges] = useState<Challenge[]>(initialChallenges);
const [loading, setLoading] = useState(false);
const [selectedChallenge, setSelectedChallenge] = useState<Challenge | null>(
null
);
@@ -260,12 +259,6 @@ export default function ChallengeManagement({ initialChallenges }: ChallengeMana
});
};
if (loading) {
return (
<div className="text-center text-pixel-gold py-8">Chargement...</div>
);
}
if (challenges.length === 0) {
return <div className="text-center text-gray-400 py-8">Aucun défi</div>;
}