import Component from '../../component.js';
import CoUxModal from './ux-modal.js';

export default class CoUxMessageBox extends Component {
    constructor(parent) {
      let selector = 'ux-message-box';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-message-box/ux-message-box.component.ts
    }

    get dataE2E() {
      return this.uxModalCo.currentPath;
    }
    get uxModalCo() {
      return new CoUxModal(this.currentPath);
    }
    async typeClass() {
      return await (await $(this.currentPath)).getAttribute('typeclass');
    }

    // BODY
    get bodyIcon() {
      return this.uxModalCo.bodyPlaceholder + '//div[contains(@class, "ux-message-box__body-icon")]';
    }
    async hasBodyIcon() {
      return await (await $(this.bodyIcon)).isExisting();
    }
    get bodyContent() {
      return this.uxModalCo.bodyPlaceholder + '//div[contains(@class, "ux-message-box__body-content")]';
    }

    // FOOTER
    get messageBoxFooter() {
      return this.uxModalCo.footer + '//uxmessageboxfooter';
    }
    async dismissBtn() {
      return await $(this.uxModalCo.footerDismissActionBtn);
    }
    async acceptBtn() {
      return await $(this.uxModalCo.footerAcceptActionBtn);
    }
}


