Initial commit: LexMind - Plataforma Jurídica Inteligente
This commit is contained in:
36
src/app/dashboard/layout.tsx
Normal file
36
src/app/dashboard/layout.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import { getServerSession } from 'next-auth'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { authOptions } from '@/lib/auth'
|
||||
import DashboardShell from './DashboardShell'
|
||||
|
||||
export const metadata = {
|
||||
title: 'Dashboard | LexMind',
|
||||
description: 'Painel de controle da plataforma LexMind',
|
||||
}
|
||||
|
||||
export default async function DashboardLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const session = await getServerSession(authOptions)
|
||||
|
||||
if (!session?.user) {
|
||||
redirect('/login')
|
||||
}
|
||||
|
||||
return (
|
||||
<DashboardShell
|
||||
user={{
|
||||
name: session.user.name,
|
||||
email: session.user.email,
|
||||
plan: session.user.plan,
|
||||
avatar: session.user.avatar,
|
||||
oabNumber: session.user.oabNumber,
|
||||
oabState: session.user.oabState,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</DashboardShell>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user