added tons of features
This commit is contained in:
26
app/[locale]/(root)/(cabinet)/cabinet/[[...slug]]/page.tsx
Normal file
26
app/[locale]/(root)/(cabinet)/cabinet/[[...slug]]/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import can, {CanAccessResponse} from '@/actions/permission'
|
||||
import LoginForm from '@/components/auth/forms/login-form'
|
||||
import CabinetIndex from '@/components/cabinet'
|
||||
import {Access} from '@/lib/permission'
|
||||
|
||||
export default async function CabinetPage({
|
||||
params
|
||||
}: {
|
||||
params: Promise<{slug?: string[]}>
|
||||
}) {
|
||||
const user = (await can(Access.Cabinet)) as CanAccessResponse
|
||||
|
||||
if (!user.can || !user.session) {
|
||||
return (
|
||||
<div className='my-8'>
|
||||
<div className='container flex flex-col sm:flex-row'>
|
||||
<LoginForm />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
const {slug} = await params
|
||||
|
||||
return <CabinetIndex slug={slug} session={user.session} />
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user