27 lines
665 B
TypeScript
27 lines
665 B
TypeScript
import { redirect } from 'next/navigation';
|
|
import { getCurrentUser } from '@/lib/auth';
|
|
import { hasPageAccess } from '@/lib/permissions';
|
|
import DashboardLayout from '@/components/DashboardLayout';
|
|
import Messagerie from '@/components/Messagerie';
|
|
|
|
export default async function MessageriePage() {
|
|
const user = await getCurrentUser();
|
|
|
|
if (!user) {
|
|
redirect('/login');
|
|
}
|
|
|
|
const hasAccess = await hasPageAccess(user.id, '/dashboard/messagerie');
|
|
if (!hasAccess) {
|
|
redirect('/dashboard/parametres');
|
|
}
|
|
|
|
return (
|
|
<DashboardLayout user={user}>
|
|
<div className="h-full">
|
|
<Messagerie />
|
|
</div>
|
|
</DashboardLayout>
|
|
);
|
|
}
|