Refactor AdminPage and remove AdminPanel component: Simplify admin navigation by redirecting to preferences page and eliminating the AdminPanel component, streamlining the admin interface.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6m21s

This commit is contained in:
Julien Froidefond
2025-12-19 14:02:06 +01:00
parent 82069c74bc
commit 14c767cfc0
16 changed files with 440 additions and 252 deletions

View File

@@ -0,0 +1,41 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { Button } from "@/components/ui";
const adminSections = [
{ id: "preferences", label: "Préférences UI", path: "/admin/preferences" },
{ id: "users", label: "Utilisateurs", path: "/admin/users" },
{ id: "events", label: "Événements", path: "/admin/events" },
{ id: "feedbacks", label: "Feedbacks", path: "/admin/feedbacks" },
{ id: "challenges", label: "Défis", path: "/admin/challenges" },
{ id: "houses", label: "Maisons", path: "/admin/houses" },
];
export default function AdminNavigation() {
const pathname = usePathname();
return (
<div className="flex gap-4 mb-8 justify-center flex-wrap">
{adminSections.map((section) => {
const isActive = pathname === section.path ||
(section.path === "/admin/preferences" && pathname === "/admin");
return (
<Button
key={section.id}
as={Link}
href={section.path}
variant={isActive ? "primary" : "secondary"}
size="md"
className={isActive ? "bg-pixel-gold/10" : ""}
>
{section.label}
</Button>
);
})}
</div>
);
}