Added pit progress

This commit is contained in:
2025-09-06 20:11:51 +02:00
parent d05da14259
commit 5b89183791
3 changed files with 28 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import { getLevelColor, getPrestige, getPrestigeColor } from "@/lib/hypixel/pit/
import { getPitLevel } from "@/lib/hypixel/pit/level"
import { NonNullStats } from "@/lib/schema/player"
import CollapsedStats from "../../_components/CollapsedStats"
import PitProgress from "./progress"
import PitGeneralStats from "./stats"
export default function PitStats({ stats }: { stats: NonNullStats["Pit"] }) {
@@ -52,6 +53,8 @@ export default function PitStats({ stats }: { stats: NonNullStats["Pit"] }) {
</div>
</AccordionTrigger>
<AccordionContent>
<Separator className="my-4" />
<PitProgress prestige={prestige} xp={stats.profile.xp} />
<Separator className="my-4" />
<PitGeneralStats stats={stats} />
<Separator className="my-4" />

View File

@@ -0,0 +1,19 @@
import { formatNumber } from "@/lib/formatters"
import { getProgress } from "@/lib/hypixel/general"
import { getPrestigeColor, getXpForPrestige } from "@/lib/hypixel/pit/general"
import GenericProgress from "../../_components/GenericProgress"
export default function PitProgress({ prestige, xp }: { prestige: number, xp: number }) {
const presColor = getPrestigeColor(prestige)
const currentXp = getXpForPrestige(prestige)
const nextXp = getXpForPrestige(prestige + 1)
const percent = getProgress(currentXp, xp, nextXp)
return (
<GenericProgress
tooltipId="pit-progress"
tooltipContent={`${formatNumber(currentXp)}/${formatNumber(nextXp)} XP`}
percent={percent}
className={`bg-mc-${presColor}`}
/>
)
}