import PropTypes from 'prop-types';
import Spinner from 'react-bootstrap/Spinner';

function Loader(props) {
  return (
    <div className='text-center'>
      <div className='my-2'>
        <Spinner animation='border' role='status' />
      </div>
      {props.content}
    </div>
  );
}

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

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

export default Loader;
