diff --git a/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx b/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx index 93f2353..264d881 100644 --- a/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx +++ b/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx @@ -28,7 +28,7 @@ export default function CopsAndCrimsStats({ stats }: { stats: NonNullStats["Cops stats={[ { title:

Score

, - stat:

{formatNumber(score)}

+ stat:

{formatNumber(score)}

}, { title:

Kills

, diff --git a/src/app/(stats)/player/[ign]/_stats/duels/duels.tsx b/src/app/(stats)/player/[ign]/_stats/duels/duels.tsx index a7989ad..0780b0a 100644 --- a/src/app/(stats)/player/[ign]/_stats/duels/duels.tsx +++ b/src/app/(stats)/player/[ign]/_stats/duels/duels.tsx @@ -29,7 +29,7 @@ export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] }) { title:

Division

, stat: ( -

+

{div !== null ? ( diff --git a/src/app/(stats)/player/[ign]/_stats/megawalls/megawalls.tsx b/src/app/(stats)/player/[ign]/_stats/megawalls/megawalls.tsx index a6cc5fd..7f7d269 100644 --- a/src/app/(stats)/player/[ign]/_stats/megawalls/megawalls.tsx +++ b/src/app/(stats)/player/[ign]/_stats/megawalls/megawalls.tsx @@ -31,7 +31,7 @@ export default function MegaWallsStats({ stats }: { stats: NonNullStats["MegaWal { title:

Main

, stat: ( -

+

{mostPlayed !== null ? mostPlayed.name : "Unknown"}

) diff --git a/src/app/(stats)/player/[ign]/_stats/pit/level.tsx b/src/app/(stats)/player/[ign]/_stats/pit/level.tsx new file mode 100644 index 0000000..122a552 --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/pit/level.tsx @@ -0,0 +1,18 @@ +import { romanize } from "@/lib/hypixel/general" +import { getLevelColor, getPrestigeColor } from "@/lib/hypixel/pit/general" +import { getPitLevel } from "@/lib/hypixel/pit/level" + +export default function PitLevel({ xp, prestige }: { xp: number, prestige: number }) { + const level = getPitLevel(xp, prestige) + const prestigeColor = getPrestigeColor(prestige) + const levelColor = getLevelColor(level) + return ( +

+ [ + {prestige > 0 && {romanize(prestige)}} + {prestige > 0 && -} + {level} + ] +

+ ) +} diff --git a/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx b/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx index 347c075..565aa29 100644 --- a/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx +++ b/src/app/(stats)/player/[ign]/_stats/pit/pit.tsx @@ -2,11 +2,11 @@ import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ import { Card, CardContent } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import { formatNumber } from "@/lib/formatters" -import { devide, romanize } from "@/lib/hypixel/general" -import { getLevelColor, getPrestige, getPrestigeColor } from "@/lib/hypixel/pit/general" -import { getPitLevel } from "@/lib/hypixel/pit/level" +import { devide } from "@/lib/hypixel/general" +import { getPrestige } from "@/lib/hypixel/pit/general" import { NonNullStats } from "@/lib/schema/player" import CollapsedStats from "../../_components/CollapsedStats" +import PitLevel from "./level" import PitProgress from "./progress" import PitGeneralStats from "./stats" @@ -15,9 +15,6 @@ export default function PitStats({ stats }: { stats: NonNullStats["Pit"] }) { const kd = formatNumber(devide(stats.kills, stats.deaths)) const prestige = getPrestige(stats) - const level = getPitLevel(stats.profile.xp, prestige) - const prestigeColor = getPrestigeColor(prestige) - const levelColor = getLevelColor(level) return ( @@ -30,15 +27,7 @@ export default function PitStats({ stats }: { stats: NonNullStats["Pit"] }) { stats={[ { title:

Level

, - stat: ( -

- [ - {prestige > 0 && {romanize(prestige)}} - {prestige > 0 && -} - {level} - ] -

- ) + stat: }, { title:

Kills

,