import Component from '../component.js';
import DivComponent from '../div.js';
import CoEuiIconButton from './eui-icon-button.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).addPredicateClassContains('eui-app-top-message__wrapper');
  }
  get contentCO() {
    return new DivComponent(this.wrapperCO).addPredicateClassContains('eui-app-top-message__content');
  }
  get messageCloseCO() {
    return new CoEuiIconButton(this.wrapperCO).addPredicateIconContains('close');
  }
  async isCloseable() {
    return await (await this.messageCloseCO.element()).isExisting();
  }
}
