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

function Loader(props) {
  return (
    <div className='flex flex-col justify-center items-center h-screen text-center'>
      <Spinner width='70' className='spinner'/>
      <div className='mt-5'>
        {props.content}
      </div>
    </div>
  );
}

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

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

export default Loader;
