export const initModal = () => {
  const modalCloses = document.querySelectorAll('.modal__close');

  if (modalCloses.length) {
    modalCloses.forEach(function (modalClose) {
      modalClose.addEventListener('click', function (event) {
        event.preventDefault();
        const modal = this.closest('.modal-overlay');
        modal.style.display = 'none';
      });
    });
  }
};
