Renamed components
This commit is contained in:
@@ -3,7 +3,7 @@ import { devide } from "@/lib/hypixel/general"
|
|||||||
import { NonNullStats } from "@/lib/schema/player"
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
import { BasicStat } from "../../_components/Stats"
|
import { BasicStat } from "../../_components/Stats"
|
||||||
|
|
||||||
export default function InfectionStats({ stats }: { stats: NonNullable<NonNullStats["MurderMystery"]> }) {
|
export default function MurderMysteryInfectionStats({ stats }: { stats: NonNullable<NonNullStats["MurderMystery"]> }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-xl font-bold">Infection</h2>
|
<h2 className="text-xl font-bold">Infection</h2>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Separator } from "@/components/ui/separator"
|
|||||||
import { formatNumber } from "@/lib/formatters"
|
import { formatNumber } from "@/lib/formatters"
|
||||||
import { NonNullStats } from "@/lib/schema/player"
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
import GeneralStats from "../GeneralStats"
|
import GeneralStats from "../GeneralStats"
|
||||||
import InfectionStats from "./infection"
|
import MurderMysteryInfectionStats from "./infection"
|
||||||
import MurderMysteryGeneralStats from "./stats"
|
import MurderMysteryGeneralStats from "./stats"
|
||||||
import MurderMysteryStatTable from "./table"
|
import MurderMysteryStatTable from "./table"
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ export default function MurderMysteryStats({ stats }: { stats: NonNullStats["Mur
|
|||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<MurderMysteryGeneralStats stats={stats} />
|
<MurderMysteryGeneralStats stats={stats} />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<InfectionStats stats={stats} />
|
<MurderMysteryInfectionStats stats={stats} />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<MurderMysteryStatTable stats={stats} />
|
<MurderMysteryStatTable stats={stats} />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Link from "next/link"
|
|||||||
import { useEffect, useState } from "react"
|
import { useEffect, useState } from "react"
|
||||||
import { Tooltip } from "react-tooltip"
|
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 })
|
const [pos, setPos] = useState({ x: 0, y: 0 })
|
||||||
|
|
||||||
useEffect(() => {
|
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 })
|
const [pos, setPos] = useState({ x: 0, y: 0 })
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { getSkywarsLevel } from "@/lib/hypixel/skywars/level"
|
|||||||
import { getSkyWarsIcon, getSkywarsPrestige } from "@/lib/hypixel/skywars/skywars"
|
import { getSkyWarsIcon, getSkywarsPrestige } from "@/lib/hypixel/skywars/skywars"
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { GenericProgress } from "../../_components/GenericProgress"
|
import { GenericProgress } from "../../_components/GenericProgress"
|
||||||
import { HeadsBar, PresigeousHeads } from "./client"
|
import { SkywarsHeadsBar, SkywarsPresigeousHeads } from "./client"
|
||||||
|
|
||||||
type SkywarsHeadsProps = {
|
type SkywarsHeadsProps = {
|
||||||
heads: number
|
heads: number
|
||||||
@@ -50,14 +50,14 @@ export function SkywarsHeads({
|
|||||||
<span className="font-bold">{"Total Heads Gathered: "}</span>
|
<span className="font-bold">{"Total Heads Gathered: "}</span>
|
||||||
<span className="text-mc-gray">{formatNumber(heads)}</span>
|
<span className="text-mc-gray">{formatNumber(heads)}</span>
|
||||||
</p>
|
</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>
|
<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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AngelOfDeath(
|
export function SkywarsAngelOfDeath(
|
||||||
{ shards, lifetime_shards, opals, lifetime_opals }: { shards: number, lifetime_shards: number, opals: number, lifetime_opals: number }
|
{ shards, lifetime_shards, opals, lifetime_opals }: { shards: number, lifetime_shards: number, opals: number, lifetime_opals: number }
|
||||||
) {
|
) {
|
||||||
return (
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1 className="font-bold">Shard Progress</h1>
|
<h1 className="font-bold">Shard Progress</h1>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { devide, getProgress } from "@/lib/hypixel/general"
|
|||||||
import { getSkywarsLevel, getSkywarsXpForLevel } from "@/lib/hypixel/skywars/level"
|
import { getSkywarsLevel, getSkywarsXpForLevel } from "@/lib/hypixel/skywars/level"
|
||||||
import { NonNullStats } from "@/lib/schema/player"
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
import GeneralStats from "../GeneralStats"
|
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 SkyWarsGeneralStats from "./stats"
|
||||||
import SkywarsStatTable from "./table"
|
import SkywarsStatTable from "./table"
|
||||||
|
|
||||||
@@ -61,8 +61,8 @@ export default function SkyWarsStats(
|
|||||||
<SkywarsStatTable stats={stats} />
|
<SkywarsStatTable stats={stats} />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<ShardProgress percent={shardProgress} shards={stats.shard} />
|
<SkywarsShardProgress percent={shardProgress} shards={stats.shard} />
|
||||||
<AngelOfDeath
|
<SkywarsAngelOfDeath
|
||||||
shards={stats.shard}
|
shards={stats.shard}
|
||||||
lifetime_shards={achievements_skywars_opal_obsession * 20000 + stats.shard}
|
lifetime_shards={achievements_skywars_opal_obsession * 20000 + stats.shard}
|
||||||
opals={stats.opals}
|
opals={stats.opals}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Separator } from "@/components/ui/separator"
|
|||||||
import { NonNullStats } from "@/lib/schema/player"
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
import GeneralStats from "../GeneralStats"
|
import GeneralStats from "../GeneralStats"
|
||||||
import TNTGamesGeneralStats from "./stats"
|
import TNTGamesGeneralStats from "./stats"
|
||||||
import TNTWizardsStats from "./wizards"
|
import TNTGamesWizardsStats from "./wizards"
|
||||||
|
|
||||||
export default function TNTGamesStats({ stats }: { stats: NonNullStats["TNTGames"] }) {
|
export default function TNTGamesStats({ stats }: { stats: NonNullStats["TNTGames"] }) {
|
||||||
if (!stats) return null
|
if (!stats) return null
|
||||||
@@ -19,7 +19,7 @@ export default function TNTGamesStats({ stats }: { stats: NonNullStats["TNTGames
|
|||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<TNTGamesGeneralStats stats={stats} />
|
<TNTGamesGeneralStats stats={stats} />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<TNTWizardsStats stats={stats} />
|
<TNTGamesWizardsStats stats={stats} />
|
||||||
</GeneralStats>
|
</GeneralStats>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { NonNullStats } from "@/lib/schema/player"
|
|||||||
import { GenericProgressNoTooltip } from "../../_components/GenericProgress"
|
import { GenericProgressNoTooltip } from "../../_components/GenericProgress"
|
||||||
import { BasicStat } from "../../_components/Stats"
|
import { BasicStat } from "../../_components/Stats"
|
||||||
|
|
||||||
export default function TNTWizardsStats({ stats }: { stats: NonNullable<NonNullStats["TNTGames"]> }) {
|
export default function TNTGamesWizardsStats({ stats }: { stats: NonNullable<NonNullStats["TNTGames"]> }) {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<h2 className="text-xl font-bold">TNT Wizards</h2>
|
<h2 className="text-xl font-bold">TNT Wizards</h2>
|
||||||
|
|||||||
35
src/app/(stats)/player/[ign]/_stats/woolgames/table.tsx
Normal file
35
src/app/(stats)/player/[ign]/_stats/woolgames/table.tsx
Normal 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>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import GeneralStats from "../GeneralStats"
|
|||||||
import { WoolGamesCaptureTheWool, WoolGamesSheepWars, WoolGamesWoolWars } from "./modes"
|
import { WoolGamesCaptureTheWool, WoolGamesSheepWars, WoolGamesWoolWars } from "./modes"
|
||||||
import WoolGamesProgress from "./progress"
|
import WoolGamesProgress from "./progress"
|
||||||
import WoolGamesGeneralStats from "./stats"
|
import WoolGamesGeneralStats from "./stats"
|
||||||
|
import WoolGamesStatTable from "./table"
|
||||||
|
|
||||||
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
||||||
if (!stats) return null
|
if (!stats) return null
|
||||||
@@ -47,6 +48,8 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam
|
|||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
<WoolGamesWoolWars ww={stats.wool_wars} />
|
<WoolGamesWoolWars ww={stats.wool_wars} />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
|
<WoolGamesStatTable stats={stats} />
|
||||||
|
<Separator className="my-4" />
|
||||||
</GeneralStats>
|
</GeneralStats>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user