diff --git a/src/app/(stats)/player/[ign]/_client.tsx b/src/app/(stats)/player/[ign]/_client.tsx index ec61e51..eca7c19 100644 --- a/src/app/(stats)/player/[ign]/_client.tsx +++ b/src/app/(stats)/player/[ign]/_client.tsx @@ -100,7 +100,14 @@ export function PlayerStats( "speeduhc": , "smashheros": , "warlords": , - "classic": + "classic": ( + + ) } as const const defaultOrder = Object.keys(statsComponents) diff --git a/src/app/(stats)/player/[ign]/_stats/classic/classic.tsx b/src/app/(stats)/player/[ign]/_stats/classic/classic.tsx index 46149d7..c18c35d 100644 --- a/src/app/(stats)/player/[ign]/_stats/classic/classic.tsx +++ b/src/app/(stats)/player/[ign]/_stats/classic/classic.tsx @@ -4,8 +4,9 @@ import { NonNullStats } from "@/lib/schema/player" import { cn } from "@/lib/utils" import CollapsedStats from "../../_components/CollapsedStats" import ArenaBrawlStats from "./arenabrawl" +import PaintballStats from "./paintball" -export default function ClassicStats({ arenaBrawlStats }: { arenaBrawlStats: NonNullStats["ArenaBrawl"] }) { +export default function ClassicStats({ stats }: { stats: { arena: NonNullStats["ArenaBrawl"], paintball: NonNullStats["Paintball"] } }) { return ( @@ -23,8 +24,9 @@ export default function ClassicStats({ arenaBrawlStats }: { arenaBrawlStats: Non - - + + + ) diff --git a/src/app/(stats)/player/[ign]/_stats/classic/paintball.tsx b/src/app/(stats)/player/[ign]/_stats/classic/paintball.tsx new file mode 100644 index 0000000..e69d41e --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/classic/paintball.tsx @@ -0,0 +1,37 @@ +import { Separator } from "@/components/ui/separator" +import { formatNumber } from "@/lib/formatters" +import { devide } from "@/lib/hypixel/general" +import { NonNullStats } from "@/lib/schema/player" +import GeneralStats from "../GeneralStats" +import { PaintballGeneralStats } from "./stats" + +export default function PaintballStats({ stats }: { stats: NonNullStats["Paintball"] }) { + if (!stats) return null + + const kd = formatNumber(devide(stats.kills, stats.deaths)) + + return ( + Kills

, + stat:

{formatNumber(stats.kills)}

+ }, + { + title:

KD

, + stat:

{kd}

+ }, + { + title:

Wins

, + stat:

{formatNumber(stats.wins)}

+ } + ]} + > + + + +
+ ) +} diff --git a/src/app/(stats)/player/[ign]/_stats/classic/stats.tsx b/src/app/(stats)/player/[ign]/_stats/classic/stats.tsx index 28ab8fe..a30748f 100644 --- a/src/app/(stats)/player/[ign]/_stats/classic/stats.tsx +++ b/src/app/(stats)/player/[ign]/_stats/classic/stats.tsx @@ -1,4 +1,6 @@ -import { formatNumber } from "@/lib/formatters" +import { formatNumber, formatSecondsToTime } from "@/lib/formatters" +import { devide } from "@/lib/hypixel/general" +import { NonNullStats } from "@/lib/schema/player" import { BasicStat } from "../../_components/Stats" export function ArenaBrawlGeneralStats({ coins, keys, ws }: { coins: number, keys: number, ws: number }) { @@ -10,3 +12,25 @@ export function ArenaBrawlGeneralStats({ coins, keys, ws }: { coins: number, key ) } + +export function PaintballGeneralStats({ stats }: { stats: NonNullable }) { + return ( +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ ) +} diff --git a/src/lib/schema/player.ts b/src/lib/schema/player.ts index e81f3d6..c5c410e 100644 --- a/src/lib/schema/player.ts +++ b/src/lib/schema/player.ts @@ -3,7 +3,7 @@ import { arcadeStatsSchema } from "./stats/arcade" import { bedwarsStatsSchema } from "./stats/bedwars" import { blitzStatsSchema } from "./stats/blitz" import { buildBattleStatsSchema } from "./stats/build-battle" -import { arenaBrawlStatsSchema } from "./stats/classic" +import { arenaBrawlStatsSchema, paintBallStatsSchema } from "./stats/classic" import { copsAndCrimsStatsSchema } from "./stats/copsandcrims" import { duelsStatsSchema } from "./stats/duels" import { megawallsStats } from "./stats/megawalls" @@ -46,7 +46,8 @@ export const playerSchema = z.looseObject({ SpeedUHC: speedUhcStatsSchema.optional(), SuperSmash: smashHerosStats.optional(), Battleground: warlordsStatsSchema.optional(), - Arena: arenaBrawlStatsSchema.optional() + Arena: arenaBrawlStatsSchema.optional(), + Paintball: paintBallStatsSchema }).transform(({ Walls3, MCGO, HungerGames, SuperSmash, Battleground, Arena, ...rest }) => { return { MegaWalls: Walls3, diff --git a/src/lib/schema/stats/classic.ts b/src/lib/schema/stats/classic.ts index a06de08..84f8986 100644 --- a/src/lib/schema/stats/classic.ts +++ b/src/lib/schema/stats/classic.ts @@ -19,3 +19,13 @@ export const arenaBrawlStatsSchema = z.object({ win_streaks_2v2: z.number().default(0), win_streaks_4v4: z.number().default(0) }) + +export const paintBallStatsSchema = z.object({ + kills: z.number().default(0), + deaths: z.number().default(0), + wins: z.number().default(0), + coins: z.number().default(0), + forcefieldTime: z.number().default(0), + killstreaks: z.number().default(0), + shots_fired: z.number().default(0) +})