import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion" import { Card, CardContent } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import { formatNumber } from "@/lib/formatters" import { getBWLevelForExp, getTotalExpForLevel } from "@/lib/hypixel/bedwars/level" import { getProgress } from "@/lib/hypixel/general" import { NonNullStats } from "@/lib/schema/player" import CollapsedStats from "../../_components/CollapsedStats" import { BedwarsLevel, BedwarsProgress } from "./components" import BedwarsGeneralStats from "./stats" import BedwarsStatTable from "./table" export default function BedwarsStats({ stats }: { stats: NonNullStats["Bedwars"] }) { if (!stats) return null const kd = formatNumber(stats.kills_bedwars / stats.deaths_bedwars) const fkd = formatNumber(stats.final_kills_bedwars / stats.final_deaths_bedwars) const wl = formatNumber(stats.wins_bedwars / stats.losses_bedwars) const bbl = formatNumber(stats.beds_broken_bedwars / stats.beds_lost_bedwars) const level = getBWLevelForExp(stats.Experience) const current = getTotalExpForLevel(level) const next = getTotalExpForLevel(level + 1) const percent = getProgress(current, stats.Experience, next) const xpProgress = stats.Experience - current const ceilingXp = next - current return (

BedWars

Level

, stat: }, { title:

WS

, stat:

{stats.winstreak ?? "?"}

}, { title:

KD

, stat:

{kd}

}, { title:

FKD

, stat:

{fkd}

}, { title:

WL

, stat:

{wl}

}, { title:

BBL

, stat:

{bbl}

} ]} />
) }