import $ from "jquery";

export const TimerTabSwitcher = ()=>{
    $('.tab-develux-timer-builder-btn-js').on('click', function () {
        $('.tab-develux-timer-builder-btn-js').removeClass('active');
        const $tabComponent = $('.develux-library-tab-component');
        $tabComponent.removeClass('active');
        $(this).addClass('active');
        const tab = $(this).data('tab');
        $('#develux_label_previewer, #develux_label_relations, #develux_timer_help_center').addClass('hidden');
        if (tab === 'develux_timer_settings') {
            $('#develux_timer_settings').addClass('active');
            $('#develux_label_previewer').removeClass('hidden');
        }else if (tab === 'develux_timer_schedule') {
            $('#develux_timer_schedule').addClass('active');
            $('#develux_label_previewer').removeClass('hidden');
        }
        else if (tab === 'develux_timer_styles') {
            $('#develux_label_previewer').removeClass('hidden');
            $('#develux_timer_styles').addClass('active');
        }
        else if (tab === 'relations') {
            $('#develux_label_relations').removeClass('hidden');
        }
        else if (tab === 'develux_timer_help_center') {
            $('#develux_timer_help_center').removeClass('hidden');
        }
    });
}