Added first table row
This commit is contained in:
@@ -2,7 +2,7 @@ import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { formatNumber } from "@/lib/formatters"
|
||||
import { getDivision, getMostPlayed } from "@/lib/hypixel/duels/duels"
|
||||
import { getAllDivisions, getMostPlayed } from "@/lib/hypixel/duels/duels"
|
||||
import { romanize } from "@/lib/hypixel/general"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
import CollapsedStats from "../../_components/CollapsedStats"
|
||||
@@ -14,7 +14,7 @@ export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] })
|
||||
|
||||
const wl = stats.wins / stats.losses
|
||||
const kd = stats.kills / stats.deaths
|
||||
const div = getDivision("all_modes", stats)
|
||||
const div = getAllDivisions(stats)
|
||||
const mostPlayed = getMostPlayed(stats)
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { Table, TableHead, TableHeader, TableRow } from "@/components/ui/table"
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
|
||||
import { formatNumber } from "@/lib/formatters"
|
||||
import { getDuelsModeStats, getModeTitle } from "@/lib/hypixel/duels/duels"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
|
||||
export default function DuelsStatTable({ stats }: { stats: NonNullStats["Duels"] }) {
|
||||
return (
|
||||
<Table>
|
||||
<DuelsTableHeader />
|
||||
<TableBody>
|
||||
<UHC1v1Stats stats={stats} />
|
||||
</TableBody>
|
||||
</Table>
|
||||
)
|
||||
}
|
||||
@@ -36,3 +41,20 @@ function DuelsTableHeader() {
|
||||
</TableHeader>
|
||||
)
|
||||
}
|
||||
|
||||
function UHC1v1Stats({ stats }: { stats: NonNullStats["Duels"] }) {
|
||||
if (!stats) return null
|
||||
|
||||
const modeStats = getDuelsModeStats("uhc_duel", stats)
|
||||
const title = getModeTitle("uhc_duel")
|
||||
|
||||
return (
|
||||
<TableRow>
|
||||
<TableCell>{title}</TableCell>
|
||||
<TableCell>I</TableCell>
|
||||
{modeStats.map((v, i) => {
|
||||
return <TableCell key={i}>{typeof v === "number" ? formatNumber(v) : v}</TableCell>
|
||||
})}
|
||||
</TableRow>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user