import Component from '../component.js';
import DivComponent from '../div.js';
import SpanComponent from '../span.js';

export default class CoEuiAppTopMessage extends Component {
  constructor(parent) {
    let selector = 'eui-app-top-message';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/layout/eui-app/eui-app-top-message/top-message.component.html
  }
  get wrapperCO() {
    return new DivComponent(this.currentPath).byClassContains('eui-app-top-message__wrapper');
  }
  get contentCO() {
    return new DivComponent(this.wrapperCO).byClassContains('eui-app-top-message__content');
  }
  get messageCloseCO() {
    return new SpanComponent(this.wrapperCO).byClassContains('eui-app-top-message__close');
  }
  async isCloseable() {
    return await (await this.messageCloseCO.element()).isExisting();
  }
}
