import React from 'react';
import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';


const ScrappeStatus = ({ status, handleSubmit }) => {
  const { t } = useTranslation();

  if (status === 'requested')
    return <button type="submit" className="btn btn-xs btn-block btn-primary" onClick={handleSubmit}><i className="fa fa-bell"></i>{t('common.execute')}</button>
  else if (status === 'done')
    return <span className='badge bg-success'>Done</span>
  else
    return <span className='badge bg-warning'>Pending</span>

}

ScrappeStatus.propTypes = {
  status: PropTypes.string,
  handleSubmit: PropTypes.func
};
export default ScrappeStatus;
