import React, { useState } from "react"; import dataImage2 from "../../assets/images/data-table-user-2.png"; import { useNavigate, useLocation } from "react-router-dom"; import { handlePagingFunc } from "../Pagination/HandlePagination"; import PaginatedList from "../Pagination/PaginatedList"; export default function MyActiveJobTable({ MyJobList, className }) { const navigate = useNavigate(); let {pathname} = useLocation() const filterCategories = ["All Categories", "Explore", "Featured"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); 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) => ( ))} }
All Product.
data

{value.title}

{value.description}
Price:{" "} {value.price * 0.01} Duration:{" "} {" "} {value.timeline_days} day(s) Expire:{" "} {" "} {value.expire} Send to:{" "} {" "} {value.job_to}
{/* PAGINATION BUTTON */} = MyJobList?.result_list.length ? true : false } data={MyJobList?.result_list} start={indexOfFirstItem} stop={indexOfLastItem} /> {/* END OF PAGINATION BUTTON */}
)}
); }