import DisplayName from "@/components/player/displayname" import { Accordion } from "@/components/ui/accordion" import { Card, CardContent } from "@/components/ui/card" import { env } from "@/lib/env/server" import { getGuild } from "@/lib/hypixel/api/guild" import { getUuid } from "@/lib/hypixel/api/mojang" import { getSession } from "@/lib/hypixel/api/online" import { getPlayer } from "@/lib/hypixel/api/player" import { getExactLevel } from "@/lib/hypixel/general/level" import { Loader2Icon, ShieldAlert } from "lucide-react" import { Metadata } from "next" import { Suspense } from "react" import { PlayerPageLoadText } from "./_client" import Sidebar from "./_components/Sidebar" 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 async function generateMetadata({ params }: { params: Promise<{ ign: string }> }): Promise { const { ign } = await params const user = await getUuid(ign) return { title: user !== null ? user.name : "Player not found" } } export default function PlayerPage({ params }: PageProps<"/player/[ign]">) { const maintenance = env.MAINTENANCE_MODE if (maintenance) { return (

Not available right now. This is just so I could have a front page for Hypixel Production API Key.

) } return ( } > ) } async function SuspendedPage({ params }: Pick, "params">) { const { ign: pign } = await params const mc = await getUuid(pign) if (!mc) { return (

Player not found

) } const player = await getPlayer(mc.id) if (!player) { return (

Player hasn't joined hypixel

) } const session = await getSession(mc.id) const guild = await getGuild(mc.id) const level = getExactLevel(player.networkExp) return (

{player.uuid}

{player.stats !== undefined ? (
) : (

No stats avaiable. If they are staff then they most likely have their api off.

)}
) }