misc_pterodactyl-panel/resources/scripts/components/elements/SuspenseSpinner.tsx

18 lines
452 B
TypeScript
Raw Normal View History

import React, { Suspense } from 'react';
import Spinner from '@/components/elements/Spinner';
import tw from 'twin.macro';
2020-02-08 23:23:08 +00:00
const SuspenseSpinner = ({ children }: { children?: React.ReactNode }) => (
<Suspense
fallback={
<div css={tw`mx-4 w-3/4 mr-4 flex items-center justify-center`}>
2020-07-04 19:39:55 +00:00
<Spinner centered/>
</div>
}
>
{children}
</Suspense>
);
2020-02-08 23:23:08 +00:00
export default SuspenseSpinner;