import Component from '../component.js'
import CoEuiToolbarLogo from './eui-toolbar-logo.js'
import CoEuiToolbarEnvironment from './eui-toolbar-environment.js'
import CoEuiToolbarApp from './eui-toolbar-app.js'
import CoEuiToolbarItems from './eui-toolbar-items.js'
import DivComponent from '../div.js'
import CoEuiToolbarCenter from './eui-toolbar-center.js'
import CoEuiLanguageSelector from './eui-language-selector.js'


export default class CoEuiToolbar extends Component {
  constructor(parent) {
    let selector = 'eui-toolbar';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/layout/eui-toolbar/toolbar.component.html
  }
  get toolbarLeftCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-toolbar__left');
  }
  get euiToolbarLogoCO() {
    return new CoEuiToolbarLogo(this.toolbarLeftCO);
  }
  async hasHeaderLogo() {
    return await (await this.euiToolbarLogoCO.element()).isExisting();
  }
  get euiToolbarEnvironmentCO() {
    return new CoEuiToolbarEnvironment(this.toolbarLeftCO);
  }
  async hasHeaderEnvironment() {
    return await (await this.euiToolbarEnvironmentCO.element()).isExisting();
  }
  get euiToolbarAppCO() {
    return new CoEuiToolbarApp(this.toolbarLeftCO);
  }
  async hasAppName() {
    return await (await this.euiToolbarAppCO.element()).isExisting();
  }
  get euiToolbarCenterCO() {
    return new CoEuiToolbarCenter(this.currentPath);
  }
  get euiToolbarItemsCO() {
    return new CoEuiToolbarItems(this.currentPath);
  }
  get euiToolbarLanguageSelectorCO() {
    return new CoEuiLanguageSelector(this.currentPath);
  }
}
