import Component  from '../component.js'
import DivComponent from '../div.js';
import AComponent from '../a.js';
import CoEuiBadge from './eui-badge.js'
import CoEuiIconSvg from './eui-icon-svg.js';
import CoEuiLabel from './eui-label.js';


export default class CoEuiOverlayHeaderTitle extends Component {
  constructor(parent) {
    let selector = 'eui-overlay-header-title';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-overlay/components/eui-overlay-header/eui-overlay-header-title/eui-overlay-header-title.component.html?at=master
  }
  get titleCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-overlay-header-title');
  }
  get titleLabelWrapperCO() {
    return new DivComponent(this.titleCO).addPredicateClassContains('eui-overlay-header-title__label-wrapper');
  }
  get titleLabelCO() {
    return new DivComponent(this.titleLabelWrapperCO).addPredicateClassContains('eui-overlay-header-title__label');
  }
  get titleCountBadgeCO() {
    return new CoEuiBadge(this.titleLabelCO).addPredicateClassContains('eui-overlay-header-title__label-count');
  }
  async hasHeaderTitleCount() {
    return await (await this.titleCountBadgeCO.element()).isExisting();
  }
  get headerTitleActionsCO() {
    return new DivComponent(this.titleLabelWrapperCO).addPredicateClassContains('eui-overlay-header-title__actions');
  }
  get headerTitleHideLabelCO() {
    return new DivComponent(this.headerTitleActionsCO).addPredicateClassContains('eui-overlay-header-title__actions-hide');
  }
  async hasHeaderTitleHideLabel() {
    return await (await this.headerTitleHideLabelCO.element()).isExisting();
  }
  get headerTitleHideLinkCO() {
    return new AComponent(this.headerTitleHideLabelCO).addPredicateClassContains('eui-u-text-link');
  }
  get headerTitleHideLinkLabelCO(){
    return new CoEuiLabel(this.headerTitleHideLinkCO)
  }
  get headerTitleHideChevronCO() {
    return new CoEuiIconSvg(this.headerTitleHideLinkCO).addPredicateIconContains('eui-icon-chevron');
  }
  get headerTitleSubActionsBarCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-overlay-header-title__subactions-bar');
  }
}


