
const initAccordions = () => {
    const accordions = document.querySelectorAll('.accordion');
    for (const accordion of accordions) {
        const trigger = accordion.querySelector('.accordion__head');
        const content = accordion.querySelector('.accordion__content');

        if (!(trigger && content)) return;

        trigger.addEventListener('click', () => {
            accordion.classList.toggle('accordion--active');
        });
    };
}

export { initAccordions };
