Updated mw stats
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
|
||||
import { formatNumber } from "@/lib/formatters"
|
||||
import { getMegaWallsModeName, getMegaWallsModeStats } from "@/lib/hypixel/megawalls/general"
|
||||
import { romanize } from "@/lib/hypixel/general"
|
||||
import { getAllClassStats, getDifficultyColor, getMegaWallsClass, getMegaWallsModeName, getMegaWallsModeStats } from "@/lib/hypixel/megawalls/general"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
|
||||
export function MegaWallsModesTable({ stats }: { stats: NonNullable<NonNullStats["MegaWalls"]> }) {
|
||||
@@ -20,8 +21,7 @@ export function MegaWallsClassesTable({ stats }: { stats: NonNullable<NonNullSta
|
||||
return (
|
||||
<Table>
|
||||
<MegaWallsClassTableHeader />
|
||||
<TableBody>
|
||||
</TableBody>
|
||||
<MegaWallsClassStats stats={stats} />
|
||||
</Table>
|
||||
)
|
||||
}
|
||||
@@ -76,6 +76,30 @@ function MegaWallsTableHeader() {
|
||||
)
|
||||
}
|
||||
|
||||
function MegaWallsClassStats({ stats }: { stats: NonNullable<NonNullStats["MegaWalls"]> }) {
|
||||
const classStats = getAllClassStats(stats)
|
||||
return (
|
||||
<TableBody>
|
||||
{classStats.map((c, i) => {
|
||||
const { id, val } = c
|
||||
const klass = getMegaWallsClass(id)
|
||||
const difColor = getDifficultyColor(klass.difficulty)
|
||||
return (
|
||||
<TableRow key={i}>
|
||||
<TableCell className={`text-mc-${difColor}`}>{klass.name}</TableCell>
|
||||
{val.map((v, j) => {
|
||||
if (j === val.length - 2) {
|
||||
return <TableCell key={j}>{v === 0 ? "-" : romanize(v)}</TableCell>
|
||||
}
|
||||
return <TableCell key={j}>{formatNumber(v)}</TableCell>
|
||||
})}
|
||||
</TableRow>
|
||||
)
|
||||
})}
|
||||
</TableBody>
|
||||
)
|
||||
}
|
||||
|
||||
function MegaWallsModeStat(
|
||||
{ modeId, stats }: { modeId: Parameters<typeof getMegaWallsModeStats>[0], stats: NonNullable<NonNullStats["MegaWalls"]> }
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user