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 { useState, useEffect, useTransition } from "react";
import { useState, useTransition } from "react";
import {
Avatar,
Input,
@@ -43,7 +43,6 @@ interface UserManagementProps {
export default function UserManagement({ initialUsers }: UserManagementProps) {
const [users, setUsers] = useState<User[]>(initialUsers);
const [loading, setLoading] = useState(false);
const [editingUser, setEditingUser] = useState<EditingUser | null>(null);
const [saving, setSaving] = useState(false);
const [deletingUserId, setDeletingUserId] = useState<string | null>(null);
@@ -183,10 +182,6 @@ export default function UserManagement({ initialUsers }: UserManagementProps) {
? Math.max(0, currentEditingUserData.xp + editingUser.xpDelta)
: 0;
if (loading) {
return <div className="text-center text-gray-400 py-8">Chargement...</div>;
}
return (
<div className="space-y-4">
{users.length === 0 ? (