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.

ScrapeRequest.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import PropTypes from 'prop-types';
  4. import ScrappeStatus from '../ScrappeStatus/ScrappeStatus';
  5. const ScrapeRequest = ({ scrape, index }) => {
  6. const { t } = useTranslation();
  7. console.log("In req", scrape)
  8. function handleSubmit(event) {
  9. event.preventDefault();
  10. }
  11. return (
  12. <tr>
  13. <td>
  14. <p>
  15. </p><h3>#{index} {scrape.location}</h3>
  16. <span className="text-muted">Count {scrape.count} +</span>
  17. <span> | </span>
  18. <span className="text-muted">{t('scrapeRequest.EstimatedTime')} {(new Date(scrape.estimate)).toLocaleString()}</span>
  19. <span> | </span>
  20. {t('scrapeRequest.ViewScrape')} <a href="scrappe.html"> {scrape.sourceUrl}</a>
  21. <p></p>
  22. <p>
  23. </p>
  24. </td>
  25. <td>
  26. {scrape.filters.map(element => (
  27. <span key={element.value} className="badge bg-primary m-1">{element.name}</span>
  28. ))}
  29. </td>
  30. <td>
  31. <ScrappeStatus status={scrape.status} handleSubmit={handleSubmit} />
  32. </td>
  33. </tr>
  34. );
  35. }
  36. ScrapeRequest.propTypes = {
  37. scrape: PropTypes.object,
  38. index: PropTypes.number
  39. };
  40. export default ScrapeRequest;