import Icon from '../Icon'; import './Loader.scss'; export interface LoaderProps { /** * variant | variant of the loader */ variant?: 'BouncingDots' | 'BlinkingDotsLoader'; } const bouncingDotsLoaderLength = [1, 2, 3, 4]; const blinkingDotsLoaderLength = [1, 2, 3]; const getBouncingDots = () => { return (
{bouncingDotsLoaderLength.map(() => { return
; })}
); }; const getBlinkingDotsLoader = () => { return (
{blinkingDotsLoaderLength.map(() => { return ; })}
); }; const Loader = ({ variant }: LoaderProps) => { return ( <> {variant === 'BouncingDots' && getBouncingDots()} {variant === 'BlinkingDotsLoader' && getBlinkingDotsLoader()} ); }; export default Loader;