import { useState } from "react"; import { PriceFormatter } from "../Helpers/PriceFormatter"; import MarketPopUp from "../MarketPlace/PopUp/MarketPopUp"; export default function AvailableJobsCard({ className, datas, hidden = false, contentDisplay, image_server, }) { //debugger; const [marketPopUp, setMarketPopUp] = useState({ show: false, data: {} }); const [imageUrl, setImageUrl] = useState(""); let thePrice = PriceFormatter( datas?.price * 0.01, datas?.currency_code, datas?.currency ); // useEffect(() => { // const imagePath = require(`../../assets/images/${datas.thumbnil}`); // Replace with your directory path for local images // setImageUrl(imagePath); // }, []); const image = localStorage.getItem("session_token") ? `${image_server}${localStorage.getItem("session_token")}/job/${ datas.job_uid }` : ""; return ( <> {contentDisplay == "grid" ? (
{ setMarketPopUp({ show: true, data: datas }); }} className="flex flex-col justify-between w-full h-full" >

{datas.title}

Added

{new Date(datas.offer_added).toLocaleDateString()}

Expires

{new Date(datas.expire).toLocaleDateString()}

{datas.description}

{/* {thePrice} | {datas.timeline_days} day(s) */} {thePrice}

( {datas.offer_code}) | {datas.timeline_days} day(s)

) : (
data

{ setMarketPopUp({ show: true, data: datas }); }} className="font-bold text-xl tracking-wide line-clamp-1 text-dark-gray dark:text-white capitalize" > {datas?.title}

{ setMarketPopUp({ show: true, data: datas }); }} className="my-2" >

{datas?.description}

Price: {thePrice}

Duration:{" "} {" "} {datas?.timeline_days} day(s)

Code:{" "} {datas?.offer_code}

)} {marketPopUp.show && ( { setMarketPopUp({ show: false, data: {} }); }} situation={marketPopUp.show} /> )} ); }