mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-10 00:46:15 +01:00
21 lines
421 B
TypeScript
21 lines
421 B
TypeScript
|
/**
|
||
|
* This component is a wrapper that display a loader while the children components have their rendering suspended
|
||
|
*/
|
||
|
|
||
|
import React, { Suspense } from 'react';
|
||
|
|
||
|
|
||
|
export const Loader: React.FC = ({children }) => {
|
||
|
const loading = (
|
||
|
<div className="fa-3x">
|
||
|
<i className="fas fa-circle-notch fa-spin" />
|
||
|
</div>
|
||
|
);
|
||
|
return (
|
||
|
<Suspense fallback={loading}>
|
||
|
{children}
|
||
|
</Suspense>
|
||
|
);
|
||
|
}
|
||
|
|