diff --git a/apps/discord-bot/src/commands/historical/session.command.tsx b/apps/discord-bot/src/commands/historical/session.command.tsx index a10cb4972..9fd1049d6 100644 --- a/apps/discord-bot/src/commands/historical/session.command.tsx +++ b/apps/discord-bot/src/commands/historical/session.command.tsx @@ -219,7 +219,7 @@ export class SessionCommand { @SubCommand({ description: (t) => t("commands.session-tntgames"), args: [PlayerArgument] }) public tntgames(context: CommandContext) { - return this.run(context, TNT_GAMES_MODES, (base) => ); + return this.run(context, TNT_GAMES_MODES, (base, mode) => ); } @SubCommand({ diff --git a/apps/discord-bot/src/commands/tntgames/tntgames.command.tsx b/apps/discord-bot/src/commands/tntgames/tntgames.command.tsx index c50cf76a1..8ac0b1712 100644 --- a/apps/discord-bot/src/commands/tntgames/tntgames.command.tsx +++ b/apps/discord-bot/src/commands/tntgames/tntgames.command.tsx @@ -6,9 +6,9 @@ * https://github.com/Statsify/statsify/blob/main/LICENSE */ -import { BaseHypixelCommand, BaseProfileProps } from "#commands/base.hypixel-command"; +import { BaseHypixelCommand, type BaseProfileProps, type ProfileData } from "#commands/base.hypixel-command"; import { Command } from "@statsify/discord"; -import { TNTGamesModes, TNT_GAMES_MODES } from "@statsify/schemas"; +import { type TNTGamesModes, TNT_GAMES_MODES } from "@statsify/schemas"; import { TNTGamesProfile } from "./tntgames.profile.js"; @Command({ description: (t) => t("commands.tntgames") }) @@ -17,7 +17,7 @@ export class TNTGamesCommand extends BaseHypixelCommand { super(TNT_GAMES_MODES); } - public getProfile(base: BaseProfileProps): JSX.Element { - return ; + public getProfile(base: BaseProfileProps, { mode }: ProfileData): JSX.Element { + return ; } } diff --git a/apps/discord-bot/src/commands/tntgames/tntgames.profile.tsx b/apps/discord-bot/src/commands/tntgames/tntgames.profile.tsx index 30506e580..e213da2b8 100644 --- a/apps/discord-bot/src/commands/tntgames/tntgames.profile.tsx +++ b/apps/discord-bot/src/commands/tntgames/tntgames.profile.tsx @@ -6,28 +6,15 @@ * https://github.com/Statsify/statsify/blob/main/LICENSE */ -import { Container, Footer, Header, SidebarItem, Table } from "#components"; -import { FormattedGame } from "@statsify/schemas"; -import { formatTime } from "@statsify/util"; +import { Container, Footer, Header, Historical, SidebarItem, Table, formatProgression } from "#components"; +import { FormattedGame, type GameMode, type TNTGamesModes } from "@statsify/schemas"; +import { formatTime, prettify } from "@statsify/util"; import type { BaseProfileProps } from "#commands/base.hypixel-command"; -interface TNTGamesModeColumnProps { - title: string; - stats: [string, string][]; +export interface TNTGamesProfileProps extends BaseProfileProps { + mode: GameMode; } -const TNTGamesModeColumn = ({ title, stats }: TNTGamesModeColumnProps) => { - const colors = ["§a", "§c", "§6"]; - - return ( - - {stats.map(([title, value], index) => ( - - ))} - - ); -}; - export const TNTGamesProfile = ({ player, background, @@ -36,16 +23,125 @@ export const TNTGamesProfile = ({ t, badge, user, + mode, time, -}: BaseProfileProps) => { +}: TNTGamesProfileProps) => { const { tntgames } = player.stats; const sidebar: SidebarItem[] = [ [t("stats.coins"), t(tntgames.coins), "§6"], [t("stats.overallWins"), t(tntgames.wins), "§e"], - [t("stats.blocksRan"), t(tntgames.blocksRan), "§7"], ]; + let table; + + switch (mode.api) { + case "tntRun": + table = ( + <> + + + + + + + + + + + + + + ); + break; + case "pvpRun": + table = ( + <> + + + + + + + + + + + + + + + + ); + break; + case "bowSpleef": + table = ( + + + + + + + ); + break; + + case "tntTag": + sidebar.push([t("stats.powerups"), t(tntgames.tntTag.powerups), "§d"]); + table = ( + <> + + + + + + + + + + + ); + break; + case "wizards": + switch (mode.submode.api) { + case "overall": + sidebar.push( + [t("stats.class"), prettify(tntgames.wizards.class), "§2"], + [t("stats.powerOrbs"), t(tntgames.wizards.powerOrbs), "§a"] + ); + + table = ( + <> + + + + + + + + + + + + + ); + break; + default: { + const stats = tntgames.wizards[mode.submode.api]; + + table = ( + + + + + + + ); + break; + } + } + break; + } + return (
- - - - - - - + {table}