import { Separator } from "@/components/ui/separator" import { formatNumber } from "@/lib/formatters" import { getCopsAndCrimsScoreColor } from "@/lib/hypixel/copsandcrims/general" import { devide } from "@/lib/hypixel/general" import { NonNullStats } from "@/lib/schema/player" import { GeneralStats } from "../stats-components" import CopsAndCrimsGeneralStats from "./stats" import CopsAndCrimsStatTable from "./table" import CopsAndCrimsWeaponStats from "./weapons" export default function CopsAndCrimsStats({ stats }: { stats: NonNullStats["CopsAndCrims"] }) { if (!stats) return null const kills = stats.kills + stats.kills_deathmatch + stats.kills_gungame const assists = stats.assists + stats.assists_deathmatch + stats.assists_gungame const deaths = stats.deaths + stats.deaths_deathmatch + stats.deaths_gungame const wins = stats.game_wins + stats.game_wins_deathmatch + stats.game_wins_gungame const kd = formatNumber(devide(kills, deaths)) const score = Math.floor(kills / 2 + (stats.bombs_planted + stats.bombs_defused) / 3 + wins + devide(kills, stats.shots_fired) * 200) const scoreColor = getCopsAndCrimsScoreColor(score) return ( Score

, stat:

{formatNumber(score)}

}, { title:

Kills

, stat:

{formatNumber(kills)}

}, { title:

KD

, stat:

{kd}

}, { title:

Wins

, stat:

{formatNumber(wins)}

} ]} >
) }