|
|
|
|
@@ -2,10 +2,10 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
|
|
|
|
|
import { formatNumber } from "@/lib/formatters"
|
|
|
|
|
import { concatStatArrays } from "@/lib/funcs"
|
|
|
|
|
import { _BedwarsStats, getBedwarsModeStats, getBestMode } from "@/lib/hypixel/bedwars"
|
|
|
|
|
import { Player } from "@/lib/schema/player"
|
|
|
|
|
import { NonNullStats } 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: NonNullStats["Bedwars"] }) {
|
|
|
|
|
return (
|
|
|
|
|
<Table>
|
|
|
|
|
<BedwarsTableHeader />
|
|
|
|
|
@@ -69,7 +69,7 @@ function BedwarsTableHeader() {
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SoloStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function SoloStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("solo", stats as _BedwarsStats)
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "solo"
|
|
|
|
|
|
|
|
|
|
@@ -83,7 +83,7 @@ function SoloStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function DoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function DoublesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("doubles", stats as _BedwarsStats)
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "doubles"
|
|
|
|
|
|
|
|
|
|
@@ -97,7 +97,7 @@ function DoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ThreesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function ThreesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("3s", stats as _BedwarsStats)
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "3s"
|
|
|
|
|
|
|
|
|
|
@@ -111,7 +111,7 @@ function ThreesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function FoursStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function FoursStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("4s", stats as _BedwarsStats)
|
|
|
|
|
const isBest = getBestMode(stats as _BedwarsStats) === "4s"
|
|
|
|
|
|
|
|
|
|
@@ -125,7 +125,7 @@ function FoursStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CoreModeStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function CoreModeStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const soloStats = getBedwarsModeStats("solo", stats as _BedwarsStats, true)
|
|
|
|
|
const doublesStats = getBedwarsModeStats("doubles", stats as _BedwarsStats, true)
|
|
|
|
|
const threesStats = getBedwarsModeStats("3s", stats as _BedwarsStats, true)
|
|
|
|
|
@@ -143,7 +143,7 @@ function CoreModeStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"]
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function FourVFourStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function FourVFourStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("4v4", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -156,7 +156,7 @@ function FourVFourStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"]
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function RushDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function RushDoublesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("rush_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -169,7 +169,7 @@ function RushDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Rush4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Rush4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("rush_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -182,7 +182,7 @@ function Rush4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function UltimateDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function UltimateDoublesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("ultimate_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -195,7 +195,7 @@ function UltimateDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bed
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Ultimate4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Ultimate4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("ultimate_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -208,7 +208,7 @@ function Ultimate4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function LuckyDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function LuckyDoublesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("lucky_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -221,7 +221,7 @@ function LuckyDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwar
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Lucky4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Lucky4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("lucky_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -234,7 +234,7 @@ function Lucky4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function VoidlessDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function VoidlessDoublesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("voidless_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -247,7 +247,7 @@ function VoidlessDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bed
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Voidless4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Voidless4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("voidless_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -260,7 +260,7 @@ function Voidless4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ArmedDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function ArmedDoublesStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("armed_2s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -273,7 +273,7 @@ function ArmedDoublesStats({ stats }: { stats: Player["player"]["stats"]["Bedwar
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Armed4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Armed4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("armed_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -286,7 +286,7 @@ function Armed4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Swap4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Swap4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("swap_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -299,7 +299,7 @@ function Swap4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Underworld4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function Underworld4sStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("underworld_4s", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -312,7 +312,7 @@ function Underworld4sStats({ stats }: { stats: Player["player"]["stats"]["Bedwar
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function CastleStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function CastleStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const modeStats = getBedwarsModeStats("castle", stats as _BedwarsStats)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
@@ -325,7 +325,7 @@ function CastleStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] })
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function AllModeStats({ stats }: { stats: Player["player"]["stats"]["Bedwars"] }) {
|
|
|
|
|
function AllModeStats({ stats }: { stats: NonNullStats["Bedwars"] }) {
|
|
|
|
|
const soloStats = getBedwarsModeStats("solo", stats as _BedwarsStats, true)
|
|
|
|
|
const doublesStats = getBedwarsModeStats("doubles", stats as _BedwarsStats, true)
|
|
|
|
|
const threesStats = getBedwarsModeStats("3s", stats as _BedwarsStats, true)
|
|
|
|
|
|