navbarban jol le vannak kezelve a redirect es letre lett hozva egy hook amivel automatikusan berakja a usernamet es ha meg nem akkor redirectel

This commit is contained in:
2025-10-15 19:08:31 +02:00
parent d1b4141e63
commit 27fc028bad
5 changed files with 140 additions and 44 deletions
@@ -4,8 +4,11 @@ import Navbar from "../../components/Navbar/Navbar.jsx"
import Footer from "../../components/Footer/Footer.jsx"
import Background from "../../assets/backgrounds/Background.jsx"
import { getUserStats } from "../../api/userApi.js"
import useRequireAuth from "../../hooks/useRequireAuth.jsx"
export default function Reports() {
const [username] = useRequireAuth({ key: "username", redirectTo: "/login" })
return (
<div className="w-full min-h-screen flex flex-col relative overflow-x-hidden">
{/* Háttér */}
@@ -24,9 +27,8 @@ export default function Reports() {
{/* Fejléc */}
<div className="text-center mb-8">
<h2 className="text-3xl font-bold text-white">Játék Riportok</h2>
<p className="text-gray-300 mt-2">
Áttekintés a legutóbbi játékokról és statisztikákról
</p>
<p className="text-gray-300 mt-2">Áttekintés a legutóbbi játékokról és statisztikákról</p>
{username && <p className="text-sm text-gray-400 mt-1">Bejelentkezett: {username}</p>}
</div>
{/* Statisztikai kártyák */}