Added smash heros general stats

This commit is contained in:
2025-09-18 10:29:34 +02:00
parent c6a4fe2a55
commit 7889c1850e
3 changed files with 33 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import { devide } from "@/lib/hypixel/general"
import { getSmashHerosDifficultyColor, getSmashHerosMostPlayedHero } from "@/lib/hypixel/smashhero/general"
import { NonNullStats } from "@/lib/schema/player"
import GeneralStats from "../GeneralStats"
import SmashHerosGeneralStats from "./stats"
export default function SmashHerosStats({ stats }: { stats: NonNullStats["SmashHeros"] }) {
if (!stats) return null
@@ -46,6 +47,8 @@ export default function SmashHerosStats({ stats }: { stats: NonNullStats["SmashH
]}
>
<Separator className="my-4" />
<SmashHerosGeneralStats stats={stats} />
<Separator className="my-4" />
</GeneralStats>
)
}

View File

@@ -0,0 +1,28 @@
import { formatNumber } from "@/lib/formatters"
import { devide } from "@/lib/hypixel/general"
import { NonNullStats } from "@/lib/schema/player"
import { BasicStat } from "../../_components/Stats"
export default function SmashHerosGeneralStats({ stats }: { stats: NonNullable<NonNullStats["SmashHeros"]> }) {
const kd = formatNumber(devide(stats.kills, stats.deaths))
const wl = formatNumber(devide(stats.wins, stats.losses))
return (
<div className="flex">
<div className="flex-1">
<BasicStat title="Coins: " value={formatNumber(stats.coins)} className="text-mc-gold" />
<BasicStat title="Smash Level: " value={formatNumber(stats.smashLevel)} className="text-mc-aqua" />
<BasicStat title="Damage Dealt: " value={formatNumber(stats.damage_dealt)} />
</div>
<div className="flex-1">
<BasicStat title="Kills: " value={formatNumber(stats.kills)} />
<BasicStat title="Deaths: " value={formatNumber(stats.deaths)} />
<BasicStat title="Kill/Death Ratio: " value={kd} />
</div>
<div className="flex-1">
<BasicStat title="Wins: " value={formatNumber(stats.wins)} />
<BasicStat title="Losses: " value={formatNumber(stats.losses)} />
<BasicStat title="Win/Loss Ratio: " value={wl} />
</div>
</div>
)
}

View File

@@ -10,6 +10,8 @@ export const smashHerosStats = z.object({
wins: z.number().default(0),
losses: z.number().default(0),
smashLevel: z.number().default(0),
coins: z.number().default(0),
damage_dealt: z.number().default(0),
class_stats: z.object({
BOTMUN: classStats,
THE_BULK: classStats,