Implement event feedback functionality: Add EventFeedback model to Prisma schema, enabling users to submit ratings and comments for events. Update EventsPageSection and AdminPanel components to support feedback management, including UI for submitting feedback and viewing existing feedbacks. Refactor registration logic to retrieve all user registrations for improved feedback handling.

This commit is contained in:
Julien Froidefond
2025-12-10 06:11:32 +01:00
parent 44be5d2e98
commit 3bd43e777e
19 changed files with 2818 additions and 33 deletions

View File

@@ -4,6 +4,7 @@ import { useState } from "react";
import ImageSelector from "@/components/ImageSelector";
import UserManagement from "@/components/UserManagement";
import EventManagement from "@/components/EventManagement";
import FeedbackManagement from "@/components/FeedbackManagement";
interface SitePreferences {
id: string;
@@ -16,7 +17,7 @@ interface AdminPanelProps {
initialPreferences: SitePreferences;
}
type AdminSection = "preferences" | "users" | "events";
type AdminSection = "preferences" | "users" | "events" | "feedbacks";
export default function AdminPanel({ initialPreferences }: AdminPanelProps) {
const [activeSection, setActiveSection] =
@@ -107,6 +108,16 @@ export default function AdminPanel({ initialPreferences }: AdminPanelProps) {
>
Événements
</button>
<button
onClick={() => setActiveSection("feedbacks")}
className={`px-6 py-3 border uppercase text-xs tracking-widest rounded transition ${
activeSection === "feedbacks"
? "border-pixel-gold bg-pixel-gold/10 text-pixel-gold"
: "border-pixel-gold/30 bg-black/60 text-gray-400 hover:border-pixel-gold/50"
}`}
>
Feedbacks
</button>
</div>
{activeSection === "preferences" && (
@@ -274,6 +285,15 @@ export default function AdminPanel({ initialPreferences }: AdminPanelProps) {
<EventManagement />
</div>
)}
{activeSection === "feedbacks" && (
<div className="bg-black/80 border border-pixel-gold/30 rounded-lg p-6 backdrop-blur-sm">
<h2 className="text-2xl font-gaming font-bold mb-6 text-pixel-gold">
Gestion des Feedbacks
</h2>
<FeedbackManagement />
</div>
)}
</div>
</section>
);