2020-07-21 22:25:39 +02:00
|
|
|
import React, { Fragment, PropsWithChildren, FunctionComponent } from 'react';
|
|
|
|
|
|
|
|
export interface WithLoaderProps {
|
|
|
|
loading?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
export const WithLoader: FunctionComponent<WithLoaderProps> = ({ loading, children }) => {
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
{
|
|
|
|
loading ?
|
2020-07-22 09:18:50 +02:00
|
|
|
<div>Chargement</div> :
|
2020-07-21 22:25:39 +02:00
|
|
|
children
|
|
|
|
}
|
|
|
|
</Fragment>
|
|
|
|
)
|
|
|
|
}
|