34 lines
934 B
TypeScript
34 lines
934 B
TypeScript
import { redirect } from 'next/navigation';
|
|
import { getCurrentUser } from '@/lib/auth';
|
|
import { hasPageAccess } from '@/lib/permissions';
|
|
import DashboardLayout from '@/components/DashboardLayout';
|
|
import UniversProTable from '@/components/UniversProTable';
|
|
|
|
export default async function UniversProPage() {
|
|
const user = await getCurrentUser();
|
|
|
|
if (!user) {
|
|
redirect('/login');
|
|
}
|
|
|
|
const hasAccess = await hasPageAccess(user.id, '/dashboard/univers-pro');
|
|
if (!hasAccess) {
|
|
redirect('/dashboard/parametres');
|
|
}
|
|
|
|
return (
|
|
<DashboardLayout user={user}>
|
|
<div className="p-4 md:p-6">
|
|
<h1 className="text-2xl md:text-3xl font-semibold text-cblack mb-1">
|
|
Univers Pro
|
|
</h1>
|
|
<p className="text-xs md:text-sm text-cgray mb-4 md:mb-6">
|
|
Base de données des contacts professionnels
|
|
</p>
|
|
|
|
<UniversProTable />
|
|
</div>
|
|
</DashboardLayout>
|
|
);
|
|
}
|