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.

ScrapeResultsPage.js 737B

12345678910111213141516171819202122232425
  1. import React, { useEffect, useState } from 'react';
  2. import { getByIdScrappe } from '../../request/scrappe';
  3. import PropTypes from 'prop-types';
  4. const ScrapeResultsPage = ({ location }) => {
  5. const [scrappeResults, setScrappeResults] = useState()
  6. useEffect(() => {
  7. getByIdScrappe(location.id).then(res => res.data.status === 'done' ? setScrappeResults(res.data.result) : setScrappeResults(res.data))
  8. }, [setScrappeResults])
  9. console.log("scrappeResults", scrappeResults)
  10. return (
  11. <div className="c-error-page">
  12. <div className="c-error-page__content">
  13. {scrappeResults.count}
  14. </div>
  15. </div>
  16. );
  17. };
  18. ScrapeResultsPage.propTypes = {
  19. location: PropTypes.object
  20. };
  21. export default ScrapeResultsPage;