Quick change

This commit is contained in:
2025-09-15 15:33:34 +02:00
parent 4d3956b1ee
commit fb32ef95e7
4 changed files with 47 additions and 39 deletions

View File

@@ -1,9 +1,52 @@
"use client"
import { Accordion } from "@/components/ui/accordion"
import { usePathname } from "next/navigation"
import { Player } from "@/lib/schema/player"
import ArcadeStats from "./_stats/arcade/arcade"
import BedwarsStats from "./_stats/bedwars/bedwars"
import BlitzStats from "./_stats/blitz/blitz"
import BuildBattleStats from "./_stats/build-battle/build-battle"
import CopsAndCrimsStats from "./_stats/copsandcrims/copsandcrims"
import DuelsStats from "./_stats/duels/duels"
import MegaWallsStats from "./_stats/megawalls/megawalls"
import MurderMysteryStats from "./_stats/murder-mystery/murder-mystery"
import PitStats from "./_stats/pit/pit"
import SkyWarsStats from "./_stats/skywars/skywars"
import TNTGamesStats from "./_stats/tnt-games/tnt-games"
import UHCStats from "./_stats/uhc/uhc"
import WoolGamesStats from "./_stats/woolgames/woolgames"
export function PlayerPageLoadText() {
const path = usePathname()
return <p>{`Loading stats for ${path.split("/").at(-1)}`}</p>
}
export default function PlayerStats(
{ stats, achievements }: { stats: NonNullable<Player["player"]["stats"]>, achievements: Player["player"]["achievements"] }
) {
return (
<div className="w-full md:w-3/4">
<Accordion type="multiple" className="space-y-4">
<BedwarsStats stats={stats.Bedwars} />
<SkyWarsStats
stats={stats.SkyWars}
achievements_skywars_opal_obsession={achievements?.["skywars_opal_obsession"] ?? 0}
/>
<DuelsStats stats={stats.Duels} />
<MurderMysteryStats stats={stats.MurderMystery} />
<BuildBattleStats stats={stats.BuildBattle} />
<UHCStats stats={stats.UHC} />
<PitStats stats={stats.Pit} />
<TNTGamesStats stats={stats.TNTGames} />
<MegaWallsStats stats={stats.MegaWalls} />
<CopsAndCrimsStats stats={stats.CopsAndCrims} />
<WoolGamesStats stats={stats.WoolGames} />
<BlitzStats stats={stats.Blitz} />
<ArcadeStats stats={stats.Arcade} />
</Accordion>
</div>
)
}