import React, { useState } from "react"; import dataImage2 from "../../assets/images/data-table-user-2.png"; import { handlePagingFunc } from "../Pagination/HandlePagination"; import PaginatedList from "../Pagination/PaginatedList"; import PendingJobsPopout from "../jobPopout/PendingJobsPopout"; import { PriceFormatter } from "../Helpers/PriceFormatter"; export default function MyPendingJobTable({ MyJobList, className }) { let [jobPopout, setJobPopout] = useState({ show: false, data: {} }); // STATE TO HOLD THE VALUE OF THE ALERT DETAILS AND DETERMINE WHEN TO SHOW const [currentPage, setCurrentPage] = useState(0); const indexOfFirstItem = Number(currentPage); const indexOfLastItem = Number(indexOfFirstItem) + Number(process.env.REACT_APP_ITEM_PER_PAGE); const currentActiveJobList = MyJobList?.result_list?.slice( indexOfFirstItem, indexOfLastItem ); const handlePagination = (e) => { handlePagingFunc(e, setCurrentPage); }; return (
{MyJobList && MyJobList?.result_list && (
{/**/} {/* */} {/* */} {/**/} { <> {MyJobList && MyJobList?.result_list && MyJobList.result_list.length > 0 ? ( currentActiveJobList.map((value, index) => { let deliveryDate = value?.expire?.split(" ")[0]; let thePrice = PriceFormatter( value?.price * 0.01, value?.currency_code, value?.currency ); return ( ); }) ) : ( )} }
All Product.
data

{value.title}

{value.description}
Price:{" "} {thePrice}
Duration:{" "} {" "} {value.timeline_days} day(s) Expire:{" "} {" "} {deliveryDate} Sent to:{" "} {" "} {value.job_to}
No Pending Task!
{/* PAGINATION BUTTON */} = MyJobList?.result_list.length ? true : false } data={MyJobList?.result_list} start={indexOfFirstItem} stop={indexOfLastItem} /> {/* END OF PAGINATION BUTTON */}
)} {/* Active Job Popout */} {jobPopout.show && ( { setJobPopout({ show: false, data: {} }); }} situation={jobPopout.show} /> )} {/* End of Active Job Popout */}
); }