import { athenaConfigOptions } from '../../global/athena-config.js';
import { handleHtml } from '../../global/helpers/athena-global-helper.js';

/**
 * Append Search Banner
 *
 * @param banner
 */
function appendSearchBanners(banner) {
    if(banner.length) {
        banner.forEach((item, key) => {
            athenaConfigOptions.searchBannerContainer.append(
                handleHtml(`
                    <div class="search-banner-image">${item.html}</div>
                `, '.search-banner-image')
            )
        });
    }
}

/**
 * Append Category Banner
 *
 * @param banner
 * @param key
 */
function appendCategoryBanner(banner, key) {
    return handleHtml(`
        <li class="item banner category-banner-image category-banner-image__${key} category-banner__number-of-products-${banner.position_of_product}" id="category-banner-image-${key}">
            ${banner.html}
        </li>
    `, '.category-banner-image');
}

//Exporting all Functions
export {
    appendSearchBanners,
    appendCategoryBanner
}