Add database and Prisma configurations, enhance event and leaderboard components with API integration, and update navigation for session management

This commit is contained in:
Julien Froidefond
2025-12-09 08:24:14 +01:00
parent f57a30eb4d
commit 4486f305f2
41 changed files with 9094 additions and 167 deletions

View File

@@ -1,9 +1,12 @@
"use client";
import Link from "next/link";
import { useSession, signOut } from "next-auth/react";
import PlayerStats from "./PlayerStats";
export default function Navigation() {
const { data: session } = useSession();
return (
<nav className="w-full fixed top-0 left-0 z-50 px-8 py-3 bg-black/80 backdrop-blur-sm border-b border-gray-800/30">
<div className="max-w-7xl mx-auto flex items-center justify-between">
@@ -39,11 +42,44 @@ export default function Navigation() {
>
LEADERBOARD
</Link>
{session?.user?.role === "ADMIN" && (
<Link
href="/admin"
className="text-pixel-gold hover:text-orange-400 transition text-xs font-normal uppercase tracking-widest"
>
ADMIN
</Link>
)}
</div>
{/* Player Stats - Right */}
<div>
<PlayerStats />
{/* Right Side */}
<div className="flex items-center gap-4">
{session ? (
<>
<PlayerStats />
<button
onClick={() => signOut()}
className="text-gray-400 hover:text-pixel-gold transition text-xs font-normal uppercase tracking-widest"
>
Déconnexion
</button>
</>
) : (
<>
<Link
href="/login"
className="text-white hover:text-pixel-gold transition text-xs font-normal uppercase tracking-widest"
>
Connexion
</Link>
<Link
href="/register"
className="px-4 py-2 border border-pixel-gold/50 bg-black/60 text-white uppercase text-xs tracking-widest rounded hover:bg-pixel-gold/10 hover:border-pixel-gold transition"
>
Inscription
</Link>
</>
)}
</div>
</div>
</nav>