added wool games stats card
This commit is contained in:
27
src/app/(stats)/player/[ign]/_stats/woolgames/woolgames.tsx
Normal file
27
src/app/(stats)/player/[ign]/_stats/woolgames/woolgames.tsx
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
|
||||||
|
import { Card, CardContent } from "@/components/ui/card"
|
||||||
|
import { Separator } from "@/components/ui/separator"
|
||||||
|
import { NonNullStats } from "@/lib/schema/player"
|
||||||
|
import CollapsedStats from "../../_components/CollapsedStats"
|
||||||
|
|
||||||
|
export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGames"] }) {
|
||||||
|
if (!stats) return null
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AccordionItem value="woolgames">
|
||||||
|
<Card className="py-0">
|
||||||
|
<CardContent>
|
||||||
|
<AccordionTrigger className="items-center py-2 hover:no-underline hover:cursor-pointer">
|
||||||
|
<h1 className="text-xl font-bold">Wool Games</h1>
|
||||||
|
<div className="flex gap-4">
|
||||||
|
<CollapsedStats stats={[]} />
|
||||||
|
</div>
|
||||||
|
</AccordionTrigger>
|
||||||
|
<AccordionContent>
|
||||||
|
<Separator className="my-4" />
|
||||||
|
</AccordionContent>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</AccordionItem>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ import PitStats from "./_stats/pit/pit"
|
|||||||
import SkyWarsStats from "./_stats/skywars/skywars"
|
import SkyWarsStats from "./_stats/skywars/skywars"
|
||||||
import TNTGamesStats from "./_stats/tnt-games/tnt-games"
|
import TNTGamesStats from "./_stats/tnt-games/tnt-games"
|
||||||
import UHCStats from "./_stats/uhc/uhc"
|
import UHCStats from "./_stats/uhc/uhc"
|
||||||
|
import WoolGamesStats from "./_stats/woolgames/woolgames"
|
||||||
|
|
||||||
export async function generateMetadata({ params }: { params: Promise<{ ign: string }> }): Promise<Metadata> {
|
export async function generateMetadata({ params }: { params: Promise<{ ign: string }> }): Promise<Metadata> {
|
||||||
const { ign } = await params
|
const { ign } = await params
|
||||||
@@ -125,6 +126,7 @@ async function SuspendedPage({ params }: Pick<PageProps<"/player/[ign]">, "param
|
|||||||
<TNTGamesStats stats={player.stats.TNTGames} />
|
<TNTGamesStats stats={player.stats.TNTGames} />
|
||||||
<MegaWallsStats stats={player.stats.MegaWalls} />
|
<MegaWallsStats stats={player.stats.MegaWalls} />
|
||||||
<CopsAndCrimsStats stats={player.stats.CopsAndCrims} />
|
<CopsAndCrimsStats stats={player.stats.CopsAndCrims} />
|
||||||
|
<WoolGamesStats stats={player.stats.WoolGames} />
|
||||||
</Accordion>
|
</Accordion>
|
||||||
</div>
|
</div>
|
||||||
) :
|
) :
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import {
|
|||||||
pitStats,
|
pitStats,
|
||||||
skywarsStatsSchema,
|
skywarsStatsSchema,
|
||||||
tntGamesStatsSchema,
|
tntGamesStatsSchema,
|
||||||
uhcSchema
|
uhcSchema,
|
||||||
|
woolGamesStatsSchema
|
||||||
} from "./stats"
|
} from "./stats"
|
||||||
|
|
||||||
export const playerSchema = z.looseObject({
|
export const playerSchema = z.looseObject({
|
||||||
@@ -34,7 +35,8 @@ export const playerSchema = z.looseObject({
|
|||||||
Pit: pitStats.optional(),
|
Pit: pitStats.optional(),
|
||||||
TNTGames: tntGamesStatsSchema.optional(),
|
TNTGames: tntGamesStatsSchema.optional(),
|
||||||
Walls3: megawallsStats.optional(),
|
Walls3: megawallsStats.optional(),
|
||||||
MCGO: copsAndCrimsStatsSchema.optional()
|
MCGO: copsAndCrimsStatsSchema.optional(),
|
||||||
|
WoolGames: woolGamesStatsSchema.optional()
|
||||||
}).transform(({ Walls3, MCGO, ...rest }) => {
|
}).transform(({ Walls3, MCGO, ...rest }) => {
|
||||||
return {
|
return {
|
||||||
MegaWalls: Walls3,
|
MegaWalls: Walls3,
|
||||||
|
|||||||
@@ -723,3 +723,5 @@ export const copsAndCrimsStatsSchema = z.looseObject({
|
|||||||
sniper_charge_bonus: z.number().default(0),
|
sniper_charge_bonus: z.number().default(0),
|
||||||
...copsAndCrimsGunUpgrades()
|
...copsAndCrimsGunUpgrades()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const woolGamesStatsSchema = z.looseObject({})
|
||||||
|
|||||||
Reference in New Issue
Block a user