17 lines
359 B
TypeScript
17 lines
359 B
TypeScript
import React, { Fragment, PropsWithChildren, FunctionComponent } from 'react';
|
|
|
|
export interface WithLoaderProps {
|
|
loading?: boolean
|
|
}
|
|
|
|
export const WithLoader: FunctionComponent<WithLoaderProps> = ({ loading, children }) => {
|
|
return (
|
|
<Fragment>
|
|
{
|
|
loading ?
|
|
<div>Chargement</div> :
|
|
children
|
|
}
|
|
</Fragment>
|
|
)
|
|
} |