2019-09-28 21:59:05 +00:00
|
|
|
import React, { Suspense } from 'react';
|
|
|
|
import Spinner from '@/components/elements/Spinner';
|
|
|
|
|
2020-02-08 23:23:08 +00:00
|
|
|
const SuspenseSpinner = ({ children }: { children?: React.ReactNode }) => (
|
2019-09-28 21:59:05 +00:00
|
|
|
<Suspense
|
|
|
|
fallback={
|
|
|
|
<div className={'mx-4 w-3/4 mr-4 flex items-center justify-center'}>
|
|
|
|
<Spinner centered={true} size={'normal'}/>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Suspense>
|
|
|
|
);
|
2020-02-08 23:23:08 +00:00
|
|
|
|
|
|
|
export default SuspenseSpinner;
|