Updated wool games stats
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { formatNumber } from "@/lib/formatters"
|
||||
import { getWoolGamesLevel, getWoolGamesPrestige, getWoolGamesPretigeIcon } from "@/lib/hypixel/woolgames/general"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
import Multicolored from "../../_components/Multicolored"
|
||||
import GeneralStats from "../GeneralStats"
|
||||
|
||||
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
||||
if (!stats) return null
|
||||
|
||||
const level = getWoolGamesLevel(stats.progression?.experience)
|
||||
const icon = getWoolGamesPretigeIcon(stats.wool_wars_prestige_icon)
|
||||
const pres = getWoolGamesPrestige(level)
|
||||
const kills = (stats.capture_the_wool?.stats?.kills || 0) + (stats.sheep_wars?.stats?.kills || 0) + (stats.wool_wars?.stats?.kills || 0)
|
||||
const wins = (stats.capture_the_wool?.stats?.participated_wins || 0) + (stats.sheep_wars?.stats?.wins || 0) + (stats.wool_wars?.stats?.wins || 0)
|
||||
|
||||
@@ -14,6 +19,10 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam
|
||||
id="woolgames"
|
||||
title="Wool Games"
|
||||
collapsedStats={[
|
||||
{
|
||||
title: <p>Level</p>,
|
||||
stat: <Multicolored val={`[${Math.floor(level)}${icon}]`} color={pres.colormap} />
|
||||
},
|
||||
{
|
||||
title: <p>Kills</p>,
|
||||
stat: <p className="text-muted-foreground">{formatNumber(kills)}</p>
|
||||
|
||||
Reference in New Issue
Block a user