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


const ScrappeStatus = ({ status, handleExecute, id }) => {
  const { t } = useTranslation();
  console.log("id", id)
  if (status === 'requested')
    return <button type="submit" className="btn btn-sm btn-block btn-primary" onClick={() => handleExecute(id)}><i className="fa fa-bell"></i>{t('common.execute')}</button>
  else if (status === 'done')
    return <span className='badge bg-success text-lg'>Done</span>
  else
    return <span className='badge bg-danger text-lg'>Pending</span>

}

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