Updated wool games stats
This commit is contained in:
@@ -1,15 +1,28 @@
|
|||||||
import { Separator } from "@/components/ui/separator"
|
import { Separator } from "@/components/ui/separator"
|
||||||
|
import { formatNumber } from "@/lib/formatters"
|
||||||
import { NonNullStats } from "@/lib/schema/player"
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
import GeneralStats from "../GeneralStats"
|
import GeneralStats from "../GeneralStats"
|
||||||
|
|
||||||
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
||||||
if (!stats) return null
|
if (!stats) return null
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GeneralStats
|
<GeneralStats
|
||||||
id="woolgames"
|
id="woolgames"
|
||||||
title="Wool Games"
|
title="Wool Games"
|
||||||
collapsedStats={[]}
|
collapsedStats={[
|
||||||
|
{
|
||||||
|
title: <p>Kills</p>,
|
||||||
|
stat: <p className="text-muted-foreground">{formatNumber(kills)}</p>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <p>Wins</p>,
|
||||||
|
stat: <p className="text-muted-foreground">{formatNumber(wins)}</p>
|
||||||
|
}
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
</GeneralStats>
|
</GeneralStats>
|
||||||
|
|||||||
@@ -724,4 +724,23 @@ export const copsAndCrimsStatsSchema = z.looseObject({
|
|||||||
...copsAndCrimsGunUpgrades()
|
...copsAndCrimsGunUpgrades()
|
||||||
})
|
})
|
||||||
|
|
||||||
export const woolGamesStatsSchema = z.looseObject({})
|
export const woolGamesStatsSchema = z.looseObject({
|
||||||
|
capture_the_wool: z.looseObject({
|
||||||
|
stats: z.looseObject({
|
||||||
|
kills: z.number().default(0),
|
||||||
|
participated_wins: z.number().default(0)
|
||||||
|
}).optional()
|
||||||
|
}).optional(),
|
||||||
|
sheep_wars: z.looseObject({
|
||||||
|
stats: z.looseObject({
|
||||||
|
kills: z.number().default(0),
|
||||||
|
wins: z.number().default(0)
|
||||||
|
}).optional()
|
||||||
|
}).optional(),
|
||||||
|
wool_wars: z.looseObject({
|
||||||
|
stats: z.looseObject({
|
||||||
|
kills: z.number().default(0),
|
||||||
|
wins: z.number().default(0)
|
||||||
|
}).optional()
|
||||||
|
}).optional()
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user