Updated layout and added suspense

This commit is contained in:
2025-08-22 11:24:31 +02:00
parent b9959e86b7
commit a7c8b1cef4
7 changed files with 234 additions and 203 deletions

View File

@@ -3,6 +3,8 @@ import { getGuild } from "@/lib/hypixel/api/guild"
import { getUuid } from "@/lib/hypixel/api/mojang"
import { getPlayer } from "@/lib/hypixel/api/player"
import { getExactLevel } from "@/lib/hypixel/level"
import { Loader2Icon } from "lucide-react"
import { Suspense } from "react"
import Sidebar from "./_components/Sidebar"
import BedwarsStats from "./_stats/bedwars/bedwars"
@@ -11,8 +13,23 @@ export default async function PlayerPage({
}: {
params: Promise<{ ign: string }>
}) {
const { ign: pign } = await params
const { ign } = await params
return (
<Suspense
fallback={
<div className="flex flex-col justify-center items-center h-screen">
<Loader2Icon className="animate-spin size-30" />
<p>{`Loading stats for ${ign}`}</p>
</div>
}
>
<SuspendedPage ign={ign} />
</Suspense>
)
}
async function SuspendedPage({ ign: pign }: { ign: string }) {
const uuid = await getUuid(pign)
if (!uuid) {
return (