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 { calculateEventStatus } from "@/lib/eventStatus";
import { createEvent, updateEvent, deleteEvent } from "@/actions/admin/events";
import {
@@ -98,7 +98,6 @@ interface EventManagementProps {
export default function EventManagement({ initialEvents }: EventManagementProps) {
const [events, setEvents] = useState<Event[]>(initialEvents);
const [loading, setLoading] = useState(false);
const [editingEvent, setEditingEvent] = useState<Event | null>(null);
const [isCreating, setIsCreating] = useState(false);
const [saving, setSaving] = useState(false);
@@ -304,10 +303,6 @@ export default function EventManagement({ initialEvents }: EventManagementProps)
});
};
if (loading) {
return <div className="text-center text-gray-400 py-8">Chargement...</div>;
}
return (
<div className="space-y-4">
<div className="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3 mb-4">