import DisplayName from "@/components/player/displayname" import { Card, CardContent } from "@/components/ui/card" import { COOKIE_VALUES } from "@/data/general" 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 { cookies } from "next/headers" import { Suspense } from "react" import z from "zod" import PlayerStats, { PlayerPageLoadText } from "./_client" import Sidebar from "./_components/Sidebar" 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 c = await cookies() 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) const schema = z.array(z.string()) const { data: layout } = schema.safeParse(JSON.parse(c.get(COOKIE_VALUES.statsOrder)?.value ?? "null")) return (

{player.uuid}

{player.stats !== undefined ? : (

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

)}
) }