import $ from 'jquery';
export const TimerTabs = () =>{

    const setupTabSwitch = (tabSelector, paneSelector, activeClass, dataAttr) => {
        $(tabSelector).on('click', function(e) {
            e.preventDefault();
            if($(this).hasClass('tab-js') && window.innerWidth < 1199){
                $('.develux-previewer-show-js').parent().parent().addClass('to-trey');
                $('.develux-previewer-none-displayable-js').hide();
                $('.product-tab-content-js').addClass('expanded');
            }
            $(tabSelector).removeClass(activeClass);
            $(this).addClass(activeClass);
            $(paneSelector).removeClass(activeClass);
            const tabId = $(this).data(dataAttr);
            $('#' + tabId).addClass(activeClass);
        });
    };

    setupTabSwitch('.tab-js', '.develux-tab-timer-wrapper', 'active', 'tab');

}
