Added table

This commit is contained in:
2025-09-01 21:55:00 +02:00
parent 6e31a2e0e1
commit c2a22471b6
2 changed files with 40 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import { romanize } from "@/lib/hypixel/general"
import { NonNullStats } from "@/lib/schema/player" import { NonNullStats } from "@/lib/schema/player"
import CollapsedStats from "../../_components/CollapsedStats" import CollapsedStats from "../../_components/CollapsedStats"
import DuelsGeneralStats from "./stats" import DuelsGeneralStats from "./stats"
import DuelsStatsTable from "./table"
export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] }) { export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] }) {
if (!stats) return null if (!stats) return null
@@ -70,6 +71,7 @@ export default function DuelsStats({ stats }: { stats: NonNullStats["Duels"] })
<Separator className="my-4" /> <Separator className="my-4" />
<DuelsGeneralStats statsChecked={stats} div={div} kd={kd} wl={wl} /> <DuelsGeneralStats statsChecked={stats} div={div} kd={kd} wl={wl} />
<Separator className="my-4" /> <Separator className="my-4" />
<DuelsStatsTable stats={stats} />
</AccordionContent> </AccordionContent>
</CardContent> </CardContent>
</Card> </Card>

View File

@@ -0,0 +1,38 @@
import { Table, TableHead, TableHeader, TableRow } from "@/components/ui/table"
import { NonNullStats } from "@/lib/schema/player"
export default function DuelsStatTable({ stats }: { stats: NonNullStats["Duels"] }) {
return (
<Table>
<DuelsTableHeader />
</Table>
)
}
function DuelsTableHeader() {
const headerElements = [
"Mode",
"Div",
"Kills",
"Deaths",
"KD",
"Wins",
"Losses",
"WL",
"WS",
"Top WS",
"Melee HM",
"Arrow HM",
"Goals"
]
return (
<TableHeader>
<TableRow>
{headerElements.map((v, i) => {
return <TableHead key={i} className="font-bold">{v}</TableHead>
})}
</TableRow>
</TableHeader>
)
}