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
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m43s
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user