mirror of
https://github.com/ershisan99/www.git
synced 2026-02-04 21:12:04 +00:00
add fumadocs
This commit is contained in:
45
src/app/(home)/players/[id]/page.tsx
Normal file
45
src/app/(home)/players/[id]/page.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import { auth } from '@/server/auth'
|
||||
import { RANKED_CHANNEL, VANILLA_CHANNEL } from '@/shared/constants'
|
||||
import { HydrateClient, api } from '@/trpc/server'
|
||||
import { Suspense } from 'react'
|
||||
import { UserInfo } from './user'
|
||||
|
||||
export default async function PlayerPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>
|
||||
}) {
|
||||
const session = await auth()
|
||||
const { id } = await params
|
||||
if (id) {
|
||||
await Promise.all([
|
||||
api.history.user_games.prefetch({
|
||||
user_id: id,
|
||||
}),
|
||||
api.discord.get_user_by_id.prefetch({
|
||||
user_id: id,
|
||||
}),
|
||||
api.leaderboard.get_leaderboard.prefetch({
|
||||
channel_id: RANKED_CHANNEL,
|
||||
}),
|
||||
api.leaderboard.get_leaderboard.prefetch({
|
||||
channel_id: VANILLA_CHANNEL,
|
||||
}),
|
||||
api.leaderboard.get_user_rank.prefetch({
|
||||
channel_id: RANKED_CHANNEL,
|
||||
user_id: id,
|
||||
}),
|
||||
api.leaderboard.get_user_rank.prefetch({
|
||||
channel_id: VANILLA_CHANNEL,
|
||||
user_id: id,
|
||||
}),
|
||||
])
|
||||
}
|
||||
return (
|
||||
<Suspense>
|
||||
<HydrateClient>
|
||||
<UserInfo />
|
||||
</HydrateClient>
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user