mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { FC, Suspense, lazy } from 'react';
|
|
import InterceptModal from '@/components/modal/InterceptModal';
|
|
import LazyLoading from '@/components/loader/LazyLoading';
|
|
import DateRangePicker from '@/app/performance/[id]/components/DateRangePicker';
|
|
|
|
const PerformanceComponent = lazy(() => import('@/app/performance/[id]/components'));
|
|
|
|
type Props = {
|
|
params: Promise<{ id: string | undefined }>
|
|
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
|
|
};
|
|
|
|
const PerformanceModal: FC<Props> = async ({ params, searchParams }) => {
|
|
const id = (await params).id
|
|
const start_date = (await searchParams)!.start_date
|
|
const end_date = (await searchParams)!.end_date
|
|
|
|
return (
|
|
<InterceptModal>
|
|
<div className='space-y-5 mt-10 sm:mt-0'>
|
|
<DateRangePicker />
|
|
|
|
<Suspense key={`${start_date}${end_date}`} fallback={<LazyLoading />}>
|
|
<PerformanceComponent id={id} start_date={start_date as string} end_date={end_date as string} />
|
|
</Suspense>
|
|
</div>
|
|
</InterceptModal>
|
|
);
|
|
}
|
|
|
|
export default PerformanceModal; |