Files
hats-app/app/admin/project-assignment/project-management/page.tsx
T
Ichsan Kurniawan 279b642a7a Apply RBAC permissions across admin and tasks
Enforce page access and action-level permissions across admin and task views, including exports and record actions. Move user creation to a client component behind server-side permission checks, standardize data fetching, and remove the deprecated user-role route.
2026-11-09 17:32:31 +07:00

42 lines
1.8 KiB
TypeScript

import { type Metadata } from 'next';
import { Suspense, lazy } from 'react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import LazyLoading from '@/components/loader/LazyLoading';
import fetchData from '@/lib/fetchData';
import { getAccessPagePermission } from '@/lib/get-access-data';
const ComponentPage = lazy(() => import('./component'));
const ExportComponent = lazy(() => import('./component/Export'));
export const metadata: Metadata = {
title: "Project - Project Assignment | Admin",
}
export default async function ProjectManagementPage() {
const actions = await getAccessPagePermission('/project-assignment/project-management')
const data = await fetchData('/project')
return (
<>
<div className="flex flex-col">
<Card>
<CardHeader className='flex flex-col md:flex-row items-center justify-between space-y-5 sm:space-y-0'>
<div>
<CardTitle>Project Management</CardTitle>
<CardDescription className='mt-1'>Here&apos;s a list of projects that have been registered for project assignment!</CardDescription>
</div>
{actions.includes('EXPORT') &&
<Suspense fallback={<LazyLoading />}>
<ExportComponent data={data} />
</Suspense>
}
</CardHeader>
<CardContent>
<Suspense fallback={<LazyLoading />}>
<ComponentPage data={data} actions={actions} />
</Suspense>
</CardContent>
</Card>
</div>
</>
);
}