Added wool games genereal stats
This commit is contained in:
33
src/app/(stats)/player/[ign]/_stats/woolgames/stats.tsx
Normal file
33
src/app/(stats)/player/[ign]/_stats/woolgames/stats.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { formatNumber, formatSecondsToTime } from "@/lib/formatters"
|
||||
import { getWoolGamesPrestige } from "@/lib/hypixel/woolgames/general"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
import { BasicStat, Stat } from "../../_components/Stats"
|
||||
|
||||
export default function WoolGamesGeneralStats(
|
||||
{ stats, level, kills, wins }: { stats: NonNullable<NonNullStats["WoolGames"]>, level: number, kills: number, wins: number }
|
||||
) {
|
||||
const pres = getWoolGamesPrestige(level)
|
||||
return (
|
||||
<div className="flex">
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Level: " value={formatNumber(level)} />
|
||||
<BasicStat title="Prestige: " value={`${pres.name}`} className={`text-mc-${pres.color}`} />
|
||||
<BasicStat title="Playtime: " value={formatSecondsToTime(stats.playtime)} />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Wool: " value={formatNumber(stats.coins)} className="text-mc-gold" />
|
||||
<Stat title="Layers: ">
|
||||
<>
|
||||
<span className="text-mc-green">{stats.progression?.available_layers || 0}</span>
|
||||
<span>/</span>
|
||||
<span className="text-mc-green">{100}</span>
|
||||
</>
|
||||
</Stat>
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Total Kills: " value={formatNumber(kills)} />
|
||||
<BasicStat title="Total Wins: " value={formatNumber(wins)} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import { NonNullStats } from "@/lib/schema/player"
|
||||
import Multicolored from "../../_components/Multicolored"
|
||||
import GeneralStats from "../GeneralStats"
|
||||
import WoolGamesProgress from "./progress"
|
||||
import WoolGamesGeneralStats from "./stats"
|
||||
|
||||
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
||||
if (!stats) return null
|
||||
@@ -36,6 +37,9 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam
|
||||
>
|
||||
<Separator className="my-4" />
|
||||
<WoolGamesProgress xp={stats.progression?.experience || 0} level={level} />
|
||||
<Separator className="my-4" />
|
||||
<WoolGamesGeneralStats stats={stats} level={level} kills={kills} wins={wins} />
|
||||
<Separator className="my-4" />
|
||||
</GeneralStats>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -726,8 +726,11 @@ export const copsAndCrimsStatsSchema = z.looseObject({
|
||||
|
||||
export const woolGamesStatsSchema = z.looseObject({
|
||||
wool_wars_prestige_icon: z.string().optional(),
|
||||
playtime: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
progression: z.looseObject({
|
||||
experience: z.number().default(0)
|
||||
experience: z.number().default(0),
|
||||
available_layers: z.number().default(0)
|
||||
}).optional(),
|
||||
capture_the_wool: z.looseObject({
|
||||
stats: z.looseObject({
|
||||
|
||||
Reference in New Issue
Block a user