import PropTypes from 'prop-types';
import classNames from 'classnames';
import { ReactComponent as Spinner } from './spinner.svg';
import './spinner.css';

function Loader({ full = true, content }) {
  return (
    <div
      className={classNames(
        'flex flex-col items-center justify-center text-center',
        full ? 'h-screen' : 'py-6'
      )}
    >
      <Spinner width='70' className='spinner' />
      <div className='mt-5'>{content}</div>
    </div>
  );
}

Loader.defaultProps = {
  content: 'لطفا منتظر بمانید.'
};

Loader.propTypes = {
  full: PropTypes.bool,
  content: PropTypes.string.isRequired
};

export default Loader;
