class InfoModal implements Modal {

  constructor() {
    const _this = this;
    const closeBtn = document.getElementById("info-closeBtn");
    if (closeBtn) {
      closeBtn.onclick = ()=>{_this.setVisible(false)};
    }
  }
  
  self(): HTMLElement | null {
    return document.getElementById("info-container");
  }
  
  visible(): boolean {
    return this.self()?.style.display != "none";
  }
  
  infoMsg(): HTMLElement | null {
    return document.getElementById("info-content");
  }
  
  setMsg(s: string) {
    const infoMsg = this.infoMsg();
    if (infoMsg) {
      infoMsg.innerText = s;
    }
  }
  
  setVisible(v: boolean): void {
    const modal = this.self();
    if (modal) {
      modal.style.display = v ? "block" : "none";
    }
  }
}