Added drag and drop
This commit is contained in:
@@ -8,7 +8,9 @@ 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"
|
||||
|
||||
@@ -46,6 +48,7 @@ export default function PlayerPage({ params }: PageProps<"/player/[ign]">) {
|
||||
|
||||
async function SuspendedPage({ params }: Pick<PageProps<"/player/[ign]">, "params">) {
|
||||
const { ign: pign } = await params
|
||||
const c = await cookies()
|
||||
|
||||
const mc = await getUuid(pign)
|
||||
if (!mc) {
|
||||
@@ -70,6 +73,9 @@ async function SuspendedPage({ params }: Pick<PageProps<"/player/[ign]">, "param
|
||||
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("stats-order")?.value ?? "null"))
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center pb-5">
|
||||
<DisplayName
|
||||
@@ -101,7 +107,7 @@ async function SuspendedPage({ params }: Pick<PageProps<"/player/[ign]">, "param
|
||||
session={session}
|
||||
/>
|
||||
{player.stats !== undefined ?
|
||||
<PlayerStats stats={player.stats} achievements={player.achievements} /> :
|
||||
<PlayerStats stats={player.stats} achievements={player.achievements} layout={layout} /> :
|
||||
(
|
||||
<div className="w-3/4">
|
||||
<Card>
|
||||
|
||||
Reference in New Issue
Block a user