import React from "react";
import datas from "../../data/product_data.json";
import Layout from "../Partials/Layout";
import usersService from "../../services/UsersService";
import { useSelector } from "react-redux";
import FamilyDash from "./FamilyDash";
import FullAccountDash from "./FullAccountDash";


export default function Home(props) {

    console.log("PROPS IN HOME->",props);

//    const trending = datas.datas;
//    const jobData =  datas.datas; // api calls or cache
    const userApi = new usersService();
//    const homeData = userApi.getHomeDate();
    const {userDetails} = useSelector((state) => state?.userDetails)

    const commonHeadData =()=>{
        console.log("COMMON HEAD DATA INDEX ----------------=====---------------------");
        return 0;
    }

    return (
        <Layout>
            <div className="home-page-wrapper">
                {userDetails && userDetails?.account_type == "FAMILY" && (
                    <FamilyDash commonHeadData={commonHeadData} />
                )}
                {userDetails && userDetails?.account_type == "FULL" && (
                    <FullAccountDash   bannerList={props.bannerList} />

                )}
            </div>
        </Layout>
    );
}
// /*
//      <Layout>
//             <div className="home-page-wrapper">
//                 <Hero className="mb-10" data={userDetails} />
//                 {/* <CreateNft />
//         <TrendingSection trending={trending} className="mb-10" />*/}
// <HomeTaskDisplay
//     jobData={jobData}
//     className="mb-10"
//     bannerList={props.bannerList}
// />
{/*  <SellHistoryMarketVisitorAnalytic className="mb-10"/>
                <TopSellerTopBuyerSliderSection className="mb-10" />
                <UpdateTable className="mb-10"/>*/}
// </div>
// </Layout>


