|
|
|
@@ -1,8 +1,9 @@
|
|
|
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
|
|
|
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
|
|
|
|
import { formatNumber } from "@/lib/formatters"
|
|
|
|
import { formatNumber } from "@/lib/formatters"
|
|
|
|
import { concatStatArrays } from "@/lib/funcs"
|
|
|
|
import { concatStatArrays } from "@/lib/funcs"
|
|
|
|
import { _BedwarsStats, getBedwarsModeStats } from "@/lib/hypixel/bedwars"
|
|
|
|
import { _BedwarsStats, getBedwarsModeStats, getBestMode } from "@/lib/hypixel/bedwars"
|
|
|
|
import { Player } from "@/lib/schema/player"
|
|
|
|
import { Player } from "@/lib/schema/player"
|
|
|
|
|
|
|
|
import { cn } from "@/lib/utils"
|
|
|
|
|
|
|
|
|
|
|
|
export default function BedwarsStatTable({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
export default function BedwarsStatTable({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
@@ -70,10 +71,10 @@ function BedwarsTableHeader() {
|
|
|
|
|
|
|
|
|
|
|
|
function SoloStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function SoloStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("solo", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("solo", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "solo"
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow className={cn(isBest ? "font-bold text-mc-light-purple" : undefined)}>
|
|
|
|
<TableCell>Solo</TableCell>
|
|
|
|
<TableCell>Solo</TableCell>
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
@@ -84,10 +85,10 @@ function SoloStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
|
|
|
|
|
|
|
function DoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function DoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("doubles", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("doubles", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "doubles"
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow className={cn(isBest ? "font-bold text-mc-light-purple" : undefined)}>
|
|
|
|
<TableCell>Doubles</TableCell>
|
|
|
|
<TableCell>Doubles</TableCell>
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
@@ -98,10 +99,10 @@ function DoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }
|
|
|
|
|
|
|
|
|
|
|
|
function ThreesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function ThreesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("3s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("3s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "3s"
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow className={cn(isBest ? "font-bold text-mc-light-purple" : undefined)}>
|
|
|
|
<TableCell>3v3v3v3</TableCell>
|
|
|
|
<TableCell>3v3v3v3</TableCell>
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
@@ -112,10 +113,10 @@ function ThreesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
|
|
|
|
|
|
|
|
function FoursStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function FoursStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "4s"
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow className={cn(isBest ? "font-bold text-mc-light-purple" : undefined)}>
|
|
|
|
<TableCell>4v4v4v4</TableCell>
|
|
|
|
<TableCell>4v4v4v4</TableCell>
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
{modeStats.map((v, i) => {
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
|
|
|
@@ -145,7 +146,6 @@ function CoreModeStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"]
|
|
|
|
function FourVFourStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function FourVFourStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("4v4", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("4v4", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>4v4</TableCell>
|
|
|
|
<TableCell>4v4</TableCell>
|
|
|
|
@@ -159,7 +159,6 @@ function FourVFourStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"]
|
|
|
|
function RushDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function RushDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("rush_2s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("rush_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Rush Doubles</TableCell>
|
|
|
|
<TableCell>Rush Doubles</TableCell>
|
|
|
|
@@ -173,7 +172,6 @@ function RushDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars
|
|
|
|
function Rush4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Rush4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("rush_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("rush_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Rush 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Rush 4v4v4v4</TableCell>
|
|
|
|
@@ -187,7 +185,6 @@ function Rush4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
function UltimateDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function UltimateDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("ultimate_2s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("ultimate_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Ultimate Doubles</TableCell>
|
|
|
|
<TableCell>Ultimate Doubles</TableCell>
|
|
|
|
@@ -201,7 +198,6 @@ function UltimateDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bed
|
|
|
|
function Ultimate4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Ultimate4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("ultimate_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("ultimate_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Ultimate 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Ultimate 4v4v4v4</TableCell>
|
|
|
|
@@ -215,7 +211,6 @@ function Ultimate4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"
|
|
|
|
function LuckyDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function LuckyDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("lucky_2s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("lucky_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Lucky Doubles</TableCell>
|
|
|
|
<TableCell>Lucky Doubles</TableCell>
|
|
|
|
@@ -229,7 +224,6 @@ function LuckyDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwar
|
|
|
|
function Lucky4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Lucky4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("lucky_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("lucky_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Lucky 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Lucky 4v4v4v4</TableCell>
|
|
|
|
@@ -243,7 +237,6 @@ function Lucky4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }
|
|
|
|
function VoidlessDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function VoidlessDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("voidless_2s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("voidless_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Voidless Doubles</TableCell>
|
|
|
|
<TableCell>Voidless Doubles</TableCell>
|
|
|
|
@@ -257,7 +250,6 @@ function VoidlessDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bed
|
|
|
|
function Voidless4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Voidless4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("voidless_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("voidless_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Voidless 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Voidless 4v4v4v4</TableCell>
|
|
|
|
@@ -271,7 +263,6 @@ function Voidless4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"
|
|
|
|
function ArmedDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function ArmedDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("armed_2s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("armed_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Armed Doubles</TableCell>
|
|
|
|
<TableCell>Armed Doubles</TableCell>
|
|
|
|
@@ -285,7 +276,6 @@ function ArmedDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwar
|
|
|
|
function Armed4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Armed4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("armed_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("armed_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Armed 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Armed 4v4v4v4</TableCell>
|
|
|
|
@@ -299,7 +289,6 @@ function Armed4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }
|
|
|
|
function Swap4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Swap4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("swap_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("swap_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Swap 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Swap 4v4v4v4</TableCell>
|
|
|
|
@@ -313,7 +302,6 @@ function Swap4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
function Underworld4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function Underworld4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("underworld_4s", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("underworld_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Underworld 4v4v4v4</TableCell>
|
|
|
|
<TableCell>Underworld 4v4v4v4</TableCell>
|
|
|
|
@@ -327,7 +315,6 @@ function Underworld4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwar
|
|
|
|
function CastleStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
function CastleStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
const modeStats = getBedwarsModeStats("castle", stats as _BedwarsStats)
|
|
|
|
const modeStats = getBedwarsModeStats("castle", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TableRow>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell>Castle</TableCell>
|
|
|
|
<TableCell>Castle</TableCell>
|
|
|
|
|