mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
279b642a7a
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.
38 lines
1.4 KiB
TypeScript
38 lines
1.4 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'));
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Admin | Day Off",
|
|
}
|
|
|
|
|
|
export default async function DayOffPage() {
|
|
const actions = await getAccessPagePermission('/day-off')
|
|
const data = await fetchData('/dayoff')
|
|
|
|
return (
|
|
<>
|
|
<div className="flex flex-col">
|
|
<Card>
|
|
<CardHeader className='flex flex-row items-center justify-between space-y-2 sm:space-y-0'>
|
|
<div>
|
|
<CardTitle>Day Off Calendar</CardTitle>
|
|
<CardDescription>Here's a list of day off of H.A.T.s Calendar!</CardDescription>
|
|
</div>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<Suspense fallback={<LazyLoading />}>
|
|
<ComponentPage data={data.day_off} actions={actions} />
|
|
</Suspense>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
</>
|
|
);
|
|
} |