class OKCancelModal implements Modal {
  self(): HTMLElement | null {
    return document.getElementById("confirm-container");
  }
  
  confirmMsg(): HTMLElement | null {
    return document.getElementById("confirm-msg");
  }
  
  okBtn(): HTMLElement | null {
    return document.getElementById("yes-btn");
  }
  
  cancelBtn(): HTMLElement | null {
    return document.getElementById("no-btn");
  }
  
  visible(): boolean {
    return this.self()?.style.display != "none";
  }
  
  setVisible(v: boolean): void {
    const modal = this.self();
    if (modal) {
      modal.style.display = v ? "block" : "none";
    }
  }
  
  setMsg(s: string): void {
    const msg = this.confirmMsg();
    if (msg) {
      msg.innerText = s;
    }
  }
}