You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ScrappeStatus.jsx 753B

1234567891011121314151617181920212223
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { useTranslation } from 'react-i18next';
  4. const ScrappeStatus = ({ status, handleExecute, id }) => {
  5. const { t } = useTranslation();
  6. console.log("id", id)
  7. if (status === 'requested')
  8. 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>
  9. else if (status === 'done')
  10. return <span className='badge bg-success text-lg'>Done</span>
  11. else
  12. return <span className='badge bg-danger text-lg'>Pending</span>
  13. }
  14. ScrappeStatus.propTypes = {
  15. status: PropTypes.string,
  16. id: PropTypes.string,
  17. handleExecute: PropTypes.func
  18. };
  19. export default ScrappeStatus;