diff --git a/src/app/(stats)/player/[ign]/_stats/blitz/blitz.tsx b/src/app/(stats)/player/[ign]/_stats/blitz/blitz.tsx index 5e9b317..d58857b 100644 --- a/src/app/(stats)/player/[ign]/_stats/blitz/blitz.tsx +++ b/src/app/(stats)/player/[ign]/_stats/blitz/blitz.tsx @@ -5,12 +5,14 @@ import { devide } from "@/lib/hypixel/general" import { NonNullStats } from "@/lib/schema/player" import { cn } from "@/lib/utils" import GeneralStats from "../GeneralStats" +import BlitzGeneralStats from "./stats" +import { BlitzModeStatsTable } from "./table" export default function BlitzStats({ stats }: { stats: NonNullStats["Blitz"] }) { if (!stats) return null const kd = formatNumber(devide(stats.kills, stats.deaths)) - const wins = stats.wins_solo_normal + stats.wins_team_normal + const wins = stats.wins_solo_normal + stats.wins_teams_normal const mostPlayedKit = getBlitzMostPlayedKit(stats) return ( @@ -41,6 +43,10 @@ export default function BlitzStats({ stats }: { stats: NonNullStats["Blitz"] }) ]} > + + + + ) } diff --git a/src/app/(stats)/player/[ign]/_stats/blitz/stats.tsx b/src/app/(stats)/player/[ign]/_stats/blitz/stats.tsx new file mode 100644 index 0000000..0e4aa8d --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/blitz/stats.tsx @@ -0,0 +1,36 @@ +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 BlitzGeneralStats({ stats }: { stats: NonNullable }) { + const wins = stats.wins_solo_normal + stats.wins_teams_normal + const games = wins + stats.deaths + const losses = games - wins + + const kd = devide(stats.kills, stats.deaths) + const wl = devide(wins, losses) + const kg = devide(stats.kills, games) + + return ( +
+
+ + + + +
+
+ + + + +
+
+ + + +
+
+ ) +} diff --git a/src/app/(stats)/player/[ign]/_stats/blitz/table.tsx b/src/app/(stats)/player/[ign]/_stats/blitz/table.tsx new file mode 100644 index 0000000..0a3d973 --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/blitz/table.tsx @@ -0,0 +1,29 @@ +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" +import { formatNumber } from "@/lib/formatters" +import { NonNullStats } from "@/lib/schema/player" + +export function BlitzModeStatsTable({ stats }: { stats: NonNullable }) { + return ( + + + + Mode + Kills + Wins + + + + + Solo Normal + {formatNumber(stats.kills_solo_normal)} + {formatNumber(stats.wins_solo_normal)} + + + Teams Normal + {formatNumber(stats.kills_teams_normal)} + {formatNumber(stats.wins_teams_normal)} + + +
+ ) +} diff --git a/src/lib/schema/stats.ts b/src/lib/schema/stats.ts index 18e0d82..7c6efeb 100644 --- a/src/lib/schema/stats.ts +++ b/src/lib/schema/stats.ts @@ -854,7 +854,12 @@ function blitzKitPlayedStats() { export const blitzStatsSchema = z.object({ kills: z.number().default(0), deaths: z.number().default(0), + kills_solo_normal: z.number().default(0), + kills_teams_normal: z.number().default(0), wins_solo_normal: z.number().default(0), - wins_team_normal: z.number().default(0), + wins_teams_normal: z.number().default(0), + coins: z.number().default(0), + damage: z.number().default(0), + damage_taken: z.number().default(0), ...blitzKitPlayedStats() })