0 ? '0' : '150px' }}>
{/* Nearby City Section Section */}
{userCurrentLocation && nearbyCityData?.length > 0 && (
)}
{getFeaturedListing && getFeaturedListing.length > 0 ? (
{isLoading ? (
) : (
<>
{translate("discoverOur")} {translate("featured")} {translate("listings")}
>
)}
{isLoading
? // Show skeleton loading when data is being fetched
Array.from({ length: 8 }).map((_, index) => (
))
: getFeaturedListing?.slice(0, 8).map((ele, index) => (
))}
) : (
null
)}
{/* APARTMENT SECTION */}
{Categorydata && Categorydata.some(ele => ele.properties_count !== 0 && ele.properties_count !== "") ? (
{translate("exploreApartment")}
{/* {Categorydata.some(ele => ele.properties_count !== 0 && ele.properties_count !== "") ? ( */}
{isLoading ? (
// Show skeleton loading when data is being fetched
{Array.from({ length: 6 }).map((_, index) => (
))}
) : (
Categorydata?.map((ele, index) =>
ele.properties_count !== 0 && ele.properties_count !== "" ? (
) : null
)
)}
{/* ) : (
{translate("addDatafromAdmin")}
)} */}
) : null}
{/* ===== PROPERTIE SECTION ====== */}
{getMostViewedProp && getMostViewedProp.length > 0 ? (
{translate("most")}{" "}
{translate("viewed")}
{" "}
{translate("properties")}
{isLoading
? // Show skeleton loading when data is being fetched
Array.from({ length: 8 }).map((_, index) => (
))
: getMostViewedProp?.slice(0, 6).map((ele, index) => (
))}
) : null}
{getProjects && getProjects?.length > 0 ? (
{translate("upcoming")}{" "}
{translate("projects")}
{" "}
{translate("upcoming")}{" "}
{translate("projects")}
{" "}
{isLoading ? (
// Show skeleton loading when data is being fetched
{Array.from({ length: 6 }).map((_, index) => (
))}
) : (
getProjects?.map((ele, index) => (
handlecheckPremiumUser(e, ele.slug_id)}>
))
)}
{!isPremiumUser &&
{translate("ourPremium")}
{translate("subscribeNow")} {""}
}
) : null}
{/* user recommendation section */}
{userRecommendationData && userRecommendationData?.length > 0 ? (
{" "} {translate("personalize")}
{" "}
{translate("feed")}
{" "}
{isLoading ? (
// Show skeleton loading when data is being fetched
{Array.from({ length: 6 }).map((_, index) => (
))}
) : (
userRecommendationData?.map((ele, index) => (
))
)}
) : null}
{/* ===== PROPERTIES NEARBY CITY SECTION ====== */}
{getNearByCitysData && getNearByCitysData.length > 0 ? (
{translate("properties")}{" "}
{translate("nearby")}
{" "}
{translate("cities")}
{isLoading ? (
// Show skeleton UI
) : // Show actual data when loading is complete
getNearByCitysData?.length > 5 ? (
{getNearByCitysData && getNearByCitysData[1]?.City}
{getNearByCitysData && getNearByCitysData[1]?.Count} {translate("properties")}
{getNearByCitysData && getNearByCitysData[2]?.City}
{getNearByCitysData && getNearByCitysData[2]?.Count} {translate("properties")}
{getNearByCitysData && getNearByCitysData[0]?.City}
{getNearByCitysData && getNearByCitysData[0]?.Count} {translate("properties")}{" "}
{getNearByCitysData && getNearByCitysData[5]?.City}
{getNearByCitysData && getNearByCitysData[5]?.Count} {translate("properties")}
{getNearByCitysData && getNearByCitysData[3]?.City}
{getNearByCitysData && getNearByCitysData[3]?.Count} {translate("properties")}
{getNearByCitysData && getNearByCitysData[4]?.City}
{getNearByCitysData && getNearByCitysData[4]?.Count} {translate("properties")}
) : (
{getNearByCitysData?.slice(0, 4).map((ele, index) => (
{ele?.City}
{ele?.Count} {translate("properties")}
))}
)}
) : null}
{/* ===== MOST FAV SECTION ======= */}
{getMostFavProperties && getMostFavProperties?.length > 0 ? (
{translate("most")}{" "}
{translate("fav")}
{" "}
{translate("properties")}
{isLoading ? (
// Show skeleton loading when data is being fetched
{Array.from({ length: 6 }).map((_, index) => (
))}
) : (
getMostFavProperties?.map((ele, index) => (
))
)}
) : null}
{/* ===== AGENT SECTION ======= */}
{/*
{translate("browseByAgents")}
{isLoading ? (
// Show skeleton loading when data is being fetched
{Array.from({ length: 6 }).map((_, index) => (
))}
//
) :
agentsData?.map((ele) => (
))}
*/}
{/* ========== ARTICLE SECTION ========== */}
{getArticles && getArticles?.length > 0 ? (
{translate("our")}{" "}
{translate("articles")}
{isLoading
? // Show skeleton loading when data is being fetched
Array.from({ length: 4 }).map((_, index) => (
))
: getArticles?.slice(0, 3).map((ele, index) => (
))}
) : null}
{/* WHEN NO DATA IN ADMIN PANEL */}
{sliderdata?.length === 0 &&
getFeaturedListing?.length === 0 &&
Categorydata.every(ele => ele.properties_count === 0 || ele.properties_count === "") &&
getMostViewedProp?.length === 0 &&
getNearByCitysData?.length === 0 &&
getMostFavProperties?.length === 0 &&
getArticles?.length === 0 ? (
) : null}
{showModal &&