import React, { useEffect, useState } from "react"; import DataIteration from "../Helpers/DataIteration"; import AvailableJobsCard from "../Cards/AvailableJobsCard"; export default function MainSection({ className, marketPlaceProduct }) { const [tab, setTab] = useState("all"); const [products, setProducts] = useState(marketPlaceProduct); const tabHandler = (value) => { setTab(value); }; useEffect(() => { if (tab === "artist") { setProducts(marketPlaceProduct?.slice(0, 3)); } else if (tab === "market") { setProducts(marketPlaceProduct?.slice(0, 6)); } else if (tab === "shop") { setProducts(marketPlaceProduct?.slice(6, 9)); } else if (tab === "assets") { setProducts(marketPlaceProduct?.slice(3, 6)); } else { setProducts(marketPlaceProduct); } }, [tab, marketPlaceProduct]); return (
tabHandler("all")} className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${ tab === "all" ? "text-pink border-pink" : " border-transparent" }`} > All tabHandler("artist")} className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${ tab === "artist" ? "text-pink border-pink" : " border-transparent" }`} > Featured Artist tabHandler("market")} className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${ tab === "market" ? "text-pink border-pink" : " border-transparent" }`} > Open Market tabHandler("shop")} className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${ tab === "shop" ? "text-pink border-pink" : " border-transparent" }`} > Partner Shops tabHandler("assets")} className={`md:text-[18px] text-md text-dark-gray dark:text-white hover:text-pink border-b hover:border-pink font-medium cursor-pointer ${ tab === "assets" ? "text-pink border-pink" : " border-transparent" }`} > Game Assets
{/*
*/} {/* */} {/*
*/}
{({ datas }) => ( )}
); }