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

/**
 * Append or Remove Spinner Infinite
 */
function athenaInfiniteSpinner() {
    if(athenaConfigOptions.showSpinner) {
        document.querySelector('.athena-product-content .wrapper .product-items-cutoff')?.append(
            handleHtml(`
                  <div class="athena-spinner-loader__infinite"></div>
            `, `.athena-spinner-loader__infinite`)
        );
    } else {
        let spinner = document.querySelector(`.athena-spinner-loader__infinite`);
        if(spinner) {
            spinner.remove();
        }
    }
}


//Exporting all Functions
export {
    athenaInfiniteSpinner
}