diff --git a/src/app/(stats)/player/[ign]/_components/Stats.tsx b/src/app/(stats)/player/[ign]/_components/Stats.tsx new file mode 100644 index 0000000..d28b804 --- /dev/null +++ b/src/app/(stats)/player/[ign]/_components/Stats.tsx @@ -0,0 +1,20 @@ +import { cn } from "@/lib/utils" +import { ReactNode } from "react" + +export function BasicStat({ title, value, className }: { title: string, value: string | number, className?: string }) { + return ( +
+ {title} + {value} +
+ ) +} + +export function Stat({ title, children }: { title: string, children: ReactNode }) { + return ( ++ {title} + {children} +
+ ) +} diff --git a/src/app/(stats)/player/[ign]/_stats/bedwars/bedwars.tsx b/src/app/(stats)/player/[ign]/_stats/bedwars/bedwars.tsx index 2c21555..72261f2 100644 --- a/src/app/(stats)/player/[ign]/_stats/bedwars/bedwars.tsx +++ b/src/app/(stats)/player/[ign]/_stats/bedwars/bedwars.tsx @@ -2,7 +2,6 @@ import { Card, CardContent } from "@/components/ui/card" import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible" -import { formatNumber } from "@/lib/formatters" import { getBWLevelForExp, getTotalExpForLevel } from "@/lib/hypixel/bedwarsLevel" import { getProgress } from "@/lib/hypixel/general" import { Player } from "@/lib/schema/player" @@ -10,7 +9,8 @@ import { Separator } from "@radix-ui/react-separator" import { ChevronDown, ChevronUp, Menu } from "lucide-react" import { useEffect, useRef, useState } from "react" import CollapsedStats from "../../_components/CollapsedStats" -import { BedwarsLevel, BedWarsPrestige, BedwarsProgress } from "./bedwars-components" +import { BedwarsLevel, BedwarsProgress } from "./bedwars-components" +import BedwarsGeneralStats from "./stats" export default function BedwarsStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) { const ref = useRefWS
, - stat:{stats.winstreak ?? "?"}
+ stat:{stats.winstreak ?? "?"}
}, { title:KD
, - stat:{kd}
+ stat:{kd}
}, { title:FKD
, - stat:{fkd}
+ stat:{fkd}
}, { title:WL
, - stat:{wl}
+ stat:{wl}
}, { title:BBL
, - stat:{bbl}
+ stat:{bbl}
} ]} /> @@ -96,91 +96,7 @@ export default function BedwarsStats({ stats }: { stats: Player["player"]["stats- {"Level: "} - {`${level}.${percent.toFixed(0)}`} -
-
- {"Prestige: "}
-
- {"Tokens: "} - {formatNumber(stats.coins)} -
-- {"Kills: "} - {formatNumber(stats.kills_bedwars)} -
-- {"Deaths: "} - {formatNumber(stats.deaths_bedwars)} -
-- {"Kill/Death Ratio: "} - {kd} -
-- {"Final Kills: "} - {formatNumber(stats.final_kills_bedwars)} -
-- {"Final Deaths: "} - {formatNumber(stats.final_deaths_bedwars)} -
-- {"Final Kill/Death Ratio: "} - {fkd} -
-- {"Winstreak: "} - {stats.winstreak ?? "?"} -
-- {"Wins: "} - {formatNumber(stats.wins_bedwars)} -
-- {"Losses: "} - {formatNumber(stats.losses_bedwars)} -
-- {"Win/Loss Ratio: "} - {wl} -
-- {"Beds Broken: "} - {stats.beds_broken_bedwars} -
-- {"Beds Lost: "} - {stats.beds_lost_bedwars} -
-- {"Beds Broken/Lost: "} - {bbl} -
-- {"Total Challenges Completed: "} - {stats.total_challenges_completed} -
-
+
+
+
+
+
+
+
+