function handleClickPartnersButton() {
   const button = document.querySelector(".partners-btn");
   const accordion = document.querySelector(".partners-accordion");

   if (!button || !accordion) return;

   button.addEventListener("click", () => {
      const isOpen = accordion.classList.contains("is-open");

      if (!isOpen) {
         accordion.classList.remove("is-closing");
         accordion.classList.add("is-open");

         button.classList.add("open");
         button.classList.remove("close");
         return;
      }

      accordion.classList.remove("is-open");
      accordion.classList.add("is-closing");

      button.classList.remove("open");
      button.classList.add("close");

      accordion.addEventListener(
         "animationend",
         () => {
            accordion.classList.remove("is-closing");
         },
         { once: true }
      );
   });
}

export { handleClickPartnersButton };
