finished woolgames progress

This commit is contained in:
2025-09-11 00:35:46 +02:00
parent c7ed674a34
commit ebdfebe20a
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { formatNumber } from "@/lib/formatters"
import { getWoolGamesPrestige, getWoolGamesXPForLevel } from "@/lib/hypixel/woolgames/general"
import { GenericProgress } from "../../_components/GenericProgress"
export default function WoolGamesProgress({ xp, level }: { xp: number, level: number }) {
const pres = getWoolGamesPrestige(Math.floor(level))
const next = getWoolGamesPrestige(Math.floor(level) + 1)
const percent = (level - Math.floor(level)) * 100
const xpProgress = formatNumber(Math.floor(xp - getWoolGamesXPForLevel(Math.floor(level))))
const ceilingXp = formatNumber(Math.floor(getWoolGamesXPForLevel(Math.floor(level) + 1) - getWoolGamesXPForLevel(Math.floor(level))))
return (
<div className="flex gap-2">
<p className={`text-mc-${pres.color}`}>{Math.floor(level)}</p>
<GenericProgress
tooltipId="woolgamesprogress"
tooltipContent={`${xpProgress}/${ceilingXp} XP`}
percent={percent}
className="bg-mc-red"
/>
<p className={`text-mc-${next.color}`}>{Math.floor(level) + 1}</p>
</div>
)
}

View File

@@ -4,6 +4,7 @@ import { getWoolGamesLevel, getWoolGamesPrestige, getWoolGamesPretigeIcon } from
import { NonNullStats } from "@/lib/schema/player"
import Multicolored from "../../_components/Multicolored"
import GeneralStats from "../GeneralStats"
import WoolGamesProgress from "./progress"
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
if (!stats) return null
@@ -34,6 +35,7 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam
]}
>
<Separator className="my-4" />
<WoolGamesProgress xp={stats.progression?.experience || 0} level={level} />
</GeneralStats>
)
}