Files
MAD-Platform/app/dashboard/chauffeurs/page.tsx

34 lines
881 B
TypeScript
Raw Normal View History

2026-01-20 18:08:06 +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-20 18:08:06 +01:00
import DashboardLayout from '@/components/DashboardLayout';
import ChauffeursTable from '@/components/ChauffeursTable';
export default async function ChauffeursPage() {
const user = await getCurrentUser();
if (!user) {
redirect('/login');
}
2026-01-22 18:53:23 +01:00
const hasAccess = await hasPageAccess(user.id, '/dashboard/chauffeurs');
if (!hasAccess) {
redirect('/dashboard/parametres');
}
2026-01-20 18:08:06 +01:00
return (
<DashboardLayout user={user}>
<div className="p-6">
<h1 className="text-3xl font-semibold text-cblack mb-1">
Chauffeurs
</h1>
<p className="text-sm text-cgray mb-6">
Base de données des chauffeurs
</p>
<ChauffeursTable />
</div>
</DashboardLayout>
);
}