Renamed components

This commit is contained in:
2025-09-12 12:11:19 +02:00
parent c686be44e6
commit 66277a90dc
9 changed files with 54 additions and 16 deletions

View File

@@ -3,7 +3,7 @@ import { devide } from "@/lib/hypixel/general"
import { NonNullStats } from "@/lib/schema/player"
import { BasicStat } from "../../_components/Stats"
export default function InfectionStats({ stats }: { stats: NonNullable<NonNullStats["MurderMystery"]> }) {
export default function MurderMysteryInfectionStats({ stats }: { stats: NonNullable<NonNullStats["MurderMystery"]> }) {
return (
<div>
<h2 className="text-xl font-bold">Infection</h2>

View File

@@ -2,7 +2,7 @@ import { Separator } from "@/components/ui/separator"
import { formatNumber } from "@/lib/formatters"
import { NonNullStats } from "@/lib/schema/player"
import GeneralStats from "../GeneralStats"
import InfectionStats from "./infection"
import MurderMysteryInfectionStats from "./infection"
import MurderMysteryGeneralStats from "./stats"
import MurderMysteryStatTable from "./table"
@@ -27,7 +27,7 @@ export default function MurderMysteryStats({ stats }: { stats: NonNullStats["Mur
<Separator className="my-4" />
<MurderMysteryGeneralStats stats={stats} />
<Separator className="my-4" />
<InfectionStats stats={stats} />
<MurderMysteryInfectionStats stats={stats} />
<Separator className="my-4" />
<MurderMysteryStatTable stats={stats} />
<Separator className="my-4" />

View File

@@ -8,7 +8,7 @@ import Link from "next/link"
import { useEffect, useState } from "react"
import { Tooltip } from "react-tooltip"
export function PresigeousHeads({ heads }: { heads: { username: string, timestamp: number, sacrifice: string }[] }) {
export function SkywarsPresigeousHeads({ heads }: { heads: { username: string, timestamp: number, sacrifice: string }[] }) {
const [pos, setPos] = useState({ x: 0, y: 0 })
useEffect(() => {
@@ -51,7 +51,7 @@ export function PresigeousHeads({ heads }: { heads: { username: string, timestam
)
}
export function HeadsBar({ heads, heads_total }: { heads: [string, number][], heads_total: number }) {
export function SkywarsHeadsBar({ heads, heads_total }: { heads: [string, number][], heads_total: number }) {
const [pos, setPos] = useState({ x: 0, y: 0 })
useEffect(() => {

View File

@@ -3,7 +3,7 @@ import { getSkywarsLevel } from "@/lib/hypixel/skywars/level"
import { getSkyWarsIcon, getSkywarsPrestige } from "@/lib/hypixel/skywars/skywars"
import { cn } from "@/lib/utils"
import { GenericProgress } from "../../_components/GenericProgress"
import { HeadsBar, PresigeousHeads } from "./client"
import { SkywarsHeadsBar, SkywarsPresigeousHeads } from "./client"
type SkywarsHeadsProps = {
heads: number
@@ -50,14 +50,14 @@ export function SkywarsHeads({
<span className="font-bold">{"Total Heads Gathered: "}</span>
<span className="text-mc-gray">{formatNumber(heads)}</span>
</p>
{total_special > 0 ? <HeadsBar heads={headsArray} heads_total={heads} /> : <p>This person has no heads collected.</p>}
{total_special > 0 ? <SkywarsHeadsBar heads={headsArray} heads_total={heads} /> : <p>This person has no heads collected.</p>}
<p className="font-bold">Prestigious Head Collection</p>
{prestigeous.length > 0 ? <PresigeousHeads heads={prestigeous} /> : <p>No prestigeous heads. Now what a skill issue.</p>}
{prestigeous.length > 0 ? <SkywarsPresigeousHeads heads={prestigeous} /> : <p>No prestigeous heads. Now what a skill issue.</p>}
</div>
)
}
export function AngelOfDeath(
export function SkywarsAngelOfDeath(
{ shards, lifetime_shards, opals, lifetime_opals }: { shards: number, lifetime_shards: number, opals: number, lifetime_opals: number }
) {
return (
@@ -82,7 +82,7 @@ export function AngelOfDeath(
)
}
export function ShardProgress({ percent, shards }: { percent: number, shards: number }) {
export function SkywarsShardProgress({ percent, shards }: { percent: number, shards: number }) {
return (
<div>
<h1 className="font-bold">Shard Progress</h1>

View File

@@ -4,7 +4,7 @@ import { devide, getProgress } from "@/lib/hypixel/general"
import { getSkywarsLevel, getSkywarsXpForLevel } from "@/lib/hypixel/skywars/level"
import { NonNullStats } from "@/lib/schema/player"
import GeneralStats from "../GeneralStats"
import { AngelOfDeath, ShardProgress, SkywarsHeads, SkywarsLevel, SkywarsProgress } from "./components"
import { SkywarsAngelOfDeath, SkywarsHeads, SkywarsLevel, SkywarsProgress, SkywarsShardProgress } from "./components"
import SkyWarsGeneralStats from "./stats"
import SkywarsStatTable from "./table"
@@ -61,8 +61,8 @@ export default function SkyWarsStats(
<SkywarsStatTable stats={stats} />
<Separator className="my-4" />
<div className="space-y-2">
<ShardProgress percent={shardProgress} shards={stats.shard} />
<AngelOfDeath
<SkywarsShardProgress percent={shardProgress} shards={stats.shard} />
<SkywarsAngelOfDeath
shards={stats.shard}
lifetime_shards={achievements_skywars_opal_obsession * 20000 + stats.shard}
opals={stats.opals}

View File

@@ -2,7 +2,7 @@ import { Separator } from "@/components/ui/separator"
import { NonNullStats } from "@/lib/schema/player"
import GeneralStats from "../GeneralStats"
import TNTGamesGeneralStats from "./stats"
import TNTWizardsStats from "./wizards"
import TNTGamesWizardsStats from "./wizards"
export default function TNTGamesStats({ stats }: { stats: NonNullStats["TNTGames"] }) {
if (!stats) return null
@@ -19,7 +19,7 @@ export default function TNTGamesStats({ stats }: { stats: NonNullStats["TNTGames
<Separator className="my-4" />
<TNTGamesGeneralStats stats={stats} />
<Separator className="my-4" />
<TNTWizardsStats stats={stats} />
<TNTGamesWizardsStats stats={stats} />
</GeneralStats>
)
}

View File

@@ -6,7 +6,7 @@ import { NonNullStats } from "@/lib/schema/player"
import { GenericProgressNoTooltip } from "../../_components/GenericProgress"
import { BasicStat } from "../../_components/Stats"
export default function TNTWizardsStats({ stats }: { stats: NonNullable<NonNullStats["TNTGames"]> }) {
export default function TNTGamesWizardsStats({ stats }: { stats: NonNullable<NonNullStats["TNTGames"]> }) {
return (
<div className="space-y-4">
<h2 className="text-xl font-bold">TNT Wizards</h2>

View File

@@ -0,0 +1,35 @@
import { Table, TableBody, TableHead, TableHeader, TableRow } from "@/components/ui/table"
import { NonNullStats } from "@/lib/schema/player"
export default function WoolGamesStatTable({ stats }: { stats: NonNullable<NonNullStats["WoolGames"]> }) {
return (
<Table>
<WoolGamesTableHeader />
<TableBody>
</TableBody>
</Table>
)
}
function WoolGamesTableHeader() {
const headerElements = [
"Class",
"Kills",
"Assists",
"Deaths",
"KD",
"Wool Placed",
"Wool Broken",
"Powerups"
]
return (
<TableHeader>
<TableRow>
{headerElements.map((v, i) => {
return <TableHead key={i} className="font-bold">{v}</TableHead>
})}
</TableRow>
</TableHeader>
)
}

View File

@@ -7,6 +7,7 @@ import GeneralStats from "../GeneralStats"
import { WoolGamesCaptureTheWool, WoolGamesSheepWars, WoolGamesWoolWars } from "./modes"
import WoolGamesProgress from "./progress"
import WoolGamesGeneralStats from "./stats"
import WoolGamesStatTable from "./table"
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
if (!stats) return null
@@ -47,6 +48,8 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam
<Separator className="my-4" />
<WoolGamesWoolWars ww={stats.wool_wars} />
<Separator className="my-4" />
<WoolGamesStatTable stats={stats} />
<Separator className="my-4" />
</GeneralStats>
)
}