import { initModal, openModal } from '@bonniernews/dn-design-system-web/components/modal/modal.js';

export function initModalByline(article) {
  const modalEl = article.querySelector('.ds-modal--byline');
  if (!modalEl) return;
  initModal(modalEl);

  const bylines = article.getElementsByClassName('ds-byline');
  for (const byline of bylines) {
    byline.addEventListener('click', (e) => {
      openModal(modalEl);
    });
  }
}
