import React, {FC} from 'react';
import {LoaderProps} from './types';
import DotLoader from './DotLoader';
import Spinner from './Spinner';

const Loader: FC<LoaderProps> = ({type = 'dot', ...props}) => {
  if (type === 'spinner') {
    return <Spinner {...props} key={props.color} />;
  }
  return <DotLoader {...props} key={props.color} />;
};

export default Loader;
