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 { 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 ? (
|
||||
|
||||
Reference in New Issue
Block a user