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.

ScrappeDetails.js 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { useTranslation } from 'react-i18next';
  4. import ScrappeStatus from '../../components/ScrapeRequest/ScrappeStatus'
  5. const ScrappeDetails = (details) => {
  6. const {t} = useTranslation();
  7. return (
  8. (details.details) ?
  9. <section>
  10. <h2>Scrappe Details</h2>
  11. <br/>
  12. <div className="row">
  13. <div className="com-md-4">
  14. {
  15. (details.details.location) ?
  16. <h3>{details.details.location}</h3>
  17. : ''}
  18. {
  19. (details.details.estimate) ?
  20. <span className="text-muted">{t('scrapeRequest.EstimatedTime')} {(new Date(details.details.estimate)).toLocaleString()}</span>
  21. : ''}
  22. </div>
  23. <div className="col-md-4">
  24. {
  25. (details.details.filters && details.details.filters.length > 0) ?
  26. <div className="filters-cont">
  27. <h3>Filters</h3>
  28. {details.details.filters.map((filter,i) => <span className="badge bg-primary m-1" key={i}>{filter.name}</span>) }
  29. </div>
  30. :'' }
  31. </div>
  32. <div className="col-md-1">
  33. {details.details.status ? <ScrappeStatus status = {details.details.status} /> : '' }
  34. </div>
  35. </div>
  36. </section>
  37. : ''
  38. );
  39. }
  40. ScrappeDetails.propTypes = {
  41. details: PropTypes.object
  42. };
  43. export default ScrappeDetails;