mirror of
https://github.com/ershisan99/www.git
synced 2025-12-17 21:09:22 +00:00
wip
This commit is contained in:
31
src/app/(home)/admin/releases/page.tsx
Normal file
31
src/app/(home)/admin/releases/page.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { ReleasesClient } from '@/app/(home)/admin/releases/releases-client'
|
||||
import { auth } from '@/server/auth'
|
||||
import { HydrateClient, api } from '@/trpc/server'
|
||||
import { Suspense } from 'react'
|
||||
|
||||
export default async function ReleasesPage() {
|
||||
const session = await auth()
|
||||
const isAdmin = session?.user.role === 'admin'
|
||||
console.log(session)
|
||||
if (!isAdmin) {
|
||||
return (
|
||||
<div className={'container mx-auto pt-8'}>
|
||||
<div className={'prose'}>
|
||||
<h1>Forbidden</h1>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
await api.releases.getReleases.prefetch()
|
||||
|
||||
return (
|
||||
<Suspense>
|
||||
<HydrateClient>
|
||||
<div className={'container mx-auto pt-8'}>
|
||||
<ReleasesClient />
|
||||
</div>
|
||||
</HydrateClient>
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user