import { getWN8Percentile, Percentile, SupplementaryStats, } from '@blitzkit/core'; import { Locale } from 'discord.js'; import { translator } from '../../core/localization/translator'; import { PERCENTILE_COLORS } from '../PercentileIndicator/constants'; import { HeroStat } from './components/HeroStat'; import { WN8SurroundingStat, WN8SurroundingStatAlign, } from './components/WN8SurroundingStat'; export interface AllStatsOverviewProps { stats: { battles: number; wins: number; damage_dealt: number; damage_received: number; survived_battles: number; hits: number; shots: number; frags: number; }; supplementaryStats: SupplementaryStats; locale: Locale; } export function AllStatsOverview({ stats, locale, supplementaryStats, }: AllStatsOverviewProps) { const { t, translate } = translator(locale); const percentile = typeof supplementaryStats.WN8 === 'number' ? getWN8Percentile(supplementaryStats.WN8) : Percentile.VeryBad; const color = PERCENTILE_COLORS[percentile]; const heroStat = typeof supplementaryStats.WN8 === 'number' ? supplementaryStats.WN8.toFixed(0) : '--'; return (