Added general duels stats
This commit is contained in:
@@ -68,7 +68,8 @@ export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] })
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<Separator className="my-4" />
|
||||
<DuelsGeneralStats statsChecked={stats} div={div} kd={kd} />
|
||||
<DuelsGeneralStats statsChecked={stats} div={div} kd={kd} wl={wl} />
|
||||
<Separator className="my-4" />
|
||||
</AccordionContent>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -5,7 +5,9 @@ import { NonNullStats } from "@/lib/schema/player"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { BasicStat } from "../../_components/Stats"
|
||||
|
||||
export default function DuelsGeneralStats({ statsChecked, div, kd }: { statsChecked: NonNullStats["Duels"], div: Div | null, kd: number }) {
|
||||
export default function DuelsGeneralStats(
|
||||
{ statsChecked, div, kd, wl }: { statsChecked: NonNullStats["Duels"], div: Div | null, kd: number, wl: number }
|
||||
) {
|
||||
const stats = statsChecked!
|
||||
|
||||
return (
|
||||
@@ -34,6 +36,23 @@ export default function DuelsGeneralStats({ statsChecked, div, kd }: { statsChec
|
||||
<BasicStat title="Melee Hit Accuracy: " value={`${formatNumber(stats.melee_hits / stats.melee_swings * 100)}%`} />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Best Winstreak: " value={stats.best_overall_winstreak ?? "?"} />
|
||||
<BasicStat title="Current Winstreak: " value={stats.current_winstreak ?? "?"} />
|
||||
<p>
|
||||
<br />
|
||||
</p>
|
||||
<p>
|
||||
<br />
|
||||
</p>
|
||||
<BasicStat title="Wins: " value={formatNumber(stats.wins)} />
|
||||
<BasicStat title="Losses: " value={formatNumber(stats.losses)} />
|
||||
<BasicStat title="Win/Loss Ratio: " value={formatNumber(wl)} />
|
||||
<p>
|
||||
<br />
|
||||
</p>
|
||||
<BasicStat title="Arrows Shot: " value={formatNumber(stats.bow_shots)} />
|
||||
<BasicStat title="Arrows Hit: " value={formatNumber(stats.bow_hits)} />
|
||||
<BasicStat title="Arrows Hit Accuracy: " value={`${formatNumber(stats.bow_hits / stats.bow_shots * 100)}%`} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -277,6 +277,10 @@ export const duelsStatsSchema = z.looseObject({
|
||||
deaths: z.number().default(0),
|
||||
melee_swings: z.number().default(0),
|
||||
melee_hits: z.number().default(0),
|
||||
bow_shots: z.number().default(0),
|
||||
bow_hits: z.number().default(0),
|
||||
current_winstreak: z.number().optional(),
|
||||
best_overall_winstreak: z.number().optional(),
|
||||
//
|
||||
all_modes_rookie_title_prestige: z.number().default(-1),
|
||||
all_modes_iron_title_prestige: z.number().default(-1),
|
||||
|
||||
Reference in New Issue
Block a user