1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-08 23:46:14 +01:00
fab-manager/app/frontend/src/javascript/components/base/loader.tsx

18 lines
419 B
TypeScript
Raw Normal View History

import React, { Suspense } from 'react';
/**
* This component is a wrapper that display a loader while the children components have their rendering suspended.
*/
2021-07-01 12:34:10 +02:00
export const Loader: React.FC = ({ children }) => {
const loading = (
<div className="fa-3x">
<i className="fas fa-circle-notch fa-spin" />
</div>
2021-06-10 12:52:14 +02:00
);
return (
<Suspense fallback={loading}>
2021-07-01 12:34:10 +02:00
{children}
</Suspense>
);
2021-07-01 12:34:10 +02:00
};