Added smash heros general stats
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
28
src/app/(stats)/player/[ign]/_stats/smashheros/stats.tsx
Normal file
28
src/app/(stats)/player/[ign]/_stats/smashheros/stats.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user