mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:46:29 +00:00
42 lines
1.7 KiB
TypeScript
42 lines
1.7 KiB
TypeScript
import { type Metadata } from 'next';
|
|
import { Suspense, lazy } from 'react';
|
|
import { Separator } from '@/components/ui/separator';
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
|
import PageLoading from '@/components/loader/PageLoading';
|
|
import { fetchDataWithPost } from '@/lib/fetchData';
|
|
|
|
const FormComponent = lazy(() => import('./components'))
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Apply for Leave",
|
|
}
|
|
|
|
const WorkLeave = async () => {
|
|
const res = await fetchDataWithPost('/user/position', { position_code: 'P02' })
|
|
|
|
return (
|
|
<>
|
|
<div className='flex-1 w-full md:w-[800px] mx-auto px-5 py-10 md:p-10 pb-40 md:pb-10'>
|
|
<Card>
|
|
<CardHeader>
|
|
<div className='flex justify-center items-center flex-col'>
|
|
<div className='flex items-center space-x-2'>
|
|
<CardTitle className="text-lg font-medium">Apply for Leave</CardTitle>
|
|
<i className="ti ti-speedboat icon text-3xl"></i>
|
|
</div>
|
|
<p className="text-sm text-muted-foreground">Complete your information to apply for leave</p>
|
|
</div>
|
|
</CardHeader>
|
|
<Separator className='w-10/12 xl:w-11/12 mx-auto' />
|
|
<CardContent className='mt-6'>
|
|
<Suspense fallback={<PageLoading />}>
|
|
<FormComponent TL_LIST={res} />
|
|
</Suspense>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default WorkLeave; |