openreplay/frontend/app/components/ui/Loader/Loader.js
2022-08-16 15:47:40 +02:00

26 lines
635 B
JavaScript

import React from 'react';
import cn from 'classnames';
import styles from './loader.module.css';
import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG';
const Loader = React.memo(
({
className = '',
loading = true,
children = null,
size = 50,
style = { minHeight: '150px' },
}) =>
!loading ? (
children
) : (
<div className={cn(styles.wrapper, className)} style={style}>
{/* <div className={ styles.loader } data-size={ size } /> */}
<AnimatedSVG name={ICONS.LOADER} size={size} />
</div>
)
);
Loader.displayName = 'Loader';
export default Loader;