2026-01-21 17:34:48 +01:00
|
|
|
import { redirect } from 'next/navigation';
|
|
|
|
|
import { getCurrentUser } from '@/lib/auth';
|
2026-01-22 18:53:23 +01:00
|
|
|
import { hasPageAccess } from '@/lib/permissions';
|
2026-01-21 17:34:48 +01:00
|
|
|
import DashboardLayout from '@/components/DashboardLayout';
|
|
|
|
|
import CalendrierPageContent from '@/components/CalendrierPageContent';
|
|
|
|
|
|
|
|
|
|
export default async function CalendrierPage() {
|
|
|
|
|
const user = await getCurrentUser();
|
|
|
|
|
|
|
|
|
|
if (!user) {
|
|
|
|
|
redirect('/login');
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-22 18:53:23 +01:00
|
|
|
const hasAccess = await hasPageAccess(user.id, '/dashboard/calendrier');
|
|
|
|
|
if (!hasAccess) {
|
|
|
|
|
redirect('/dashboard/parametres');
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-21 17:34:48 +01:00
|
|
|
return (
|
|
|
|
|
<DashboardLayout user={user}>
|
2026-02-08 15:27:44 +01:00
|
|
|
<div className="p-4 sm:p-6 lg:p-8">
|
2026-01-21 17:34:48 +01:00
|
|
|
<CalendrierPageContent />
|
|
|
|
|
</div>
|
|
|
|
|
</DashboardLayout>
|
|
|
|
|
);
|
|
|
|
|
}
|