import React from "react"; import { Link } from "react-router-dom"; const AccountDashboard = ({ className, bannerList }) => { // getting the upper three banners for the home layout const getUpperBanner = bannerList?.filter((value, idx) => idx <= 2); const getLowerBanner = bannerList?.filter((value, idx) => idx > 2); let getImage = ({ banner_location, banner }) => { if (banner_location == "LOCAL") { return require(`../../assets/images/${banner}`); } else { return banner; } }; console.log(getLowerBanner); return (
{getUpperBanner?.map((props, idx) => { let image = getImage(props); let { short_title, short_description, short_button_text, link_path } = props; return ( ); })}
{getLowerBanner?.map((props, idx) => { let image = getImage(props); let { short_title, short_description, short_button_text, link_path } = props; return ( ); })}
); }; export default AccountDashboard; const TopBanner = ({ image, title = "", desc = "", btn, link_path, key }) => { return (
banner-img
{title} {desc}
{btn}
); }; const LowerBanner = ({ image, title = "", desc = "", btn, link_path, key }) => { return (
{title}

{desc}

banner-img
{btn}
); }; const BannerSection = ({ banners, variant }) => { const getImage = ({ banner_location, banner }) => { return banner_location === "LOCAL" ? require(`../../assets/images/${banner}`) : banner; }; return ( <> {banners?.map((props, idx) => { const { short_title, short_description, short_button_text, link_path } = props; const image = getImage(props); return (
banner-img
{short_title} {short_description}
{short_button_text}
); })} ); };