import Component  from '../component.js';
import CoUxAicon from './ux-a-icon.js';
import CoUxLayoutOverlayPanel from './ux-layout-overlay-panel.js';
import CoUxLanguageSelector from './ux-language-selector.js';
import CoUxDropdownButton from './ux-dropdown-button.js';
import CoUxLayoutSidebarItems from './ux-layout-sidebar-items.js';

export default class CoUxLayoutNavBarActionItem extends Component {
  constructor(parent) {
    let selector = 'ux-layout-nav-bar-action-item';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/core/src/lib/commons/ux-components/layout/ux-layout-app-shell/components/ux-layout-nav-bar/ux-layout-nav-bar-action-item.component.ts?at=support/7.x
  }
  get dataE2E() {
    let path = '//div[@data-e2e = "ux-layout-nav-bar-action-item"]'
    return this.currentPath + path;
  }
  get uxAiconCO() {
    return new CoUxAicon(this.dataE2E);
  }
  async isActive() {
    let cl = await (await $(this.dataE2E)).getAttribute('class');
    if (cl.includes('selected')){
      return true;
    } else {
      return false;
    }
  }

  get uxLayoutOverlayPanelCo() {
    return new CoUxLayoutOverlayPanel(this.currentPath);
  }

  get overlayPanel() {
    let path = '//div[contains(@class, "overlay-panel")]';
    return this.dataE2E + path
  }
  get overlayPanelHeader() {
    let path = '//div[contains(@class, "overlay-panel__header")]';
    return this.overlayPanel + path
  }
  get overlayPanelHeaderProfile() {
    let path = '//div[contains(@class, "overlay-panel__header-profile")]';
    return this.overlayPanelHeader + path
  }
  get languageSelectorCO() {
    return new CoUxLanguageSelector(this.overlayPanelHeaderProfile);
  }
  get headerCustomContent() {
    let path = '//div[contains(@class, "overlay-panel__header-custom-content")]';
    return this.overlayPanelHeaderProfile + path
  }
  get headerProfileInfo() {
    let path = '//span[contains(@class, "overlay-panel__header-profile-infos")]';
    return this.overlayPanelHeaderProfile + path
  }
  get dropdownButtonCO() {
    return new CoUxDropdownButton(this.overlayPanelHeaderProfile);
  }
  get overlayPanelInner() {
    let path = '//*[contains(@class, "overlay-panel__inner")]';
    return this.overlayPanel + path
  }
  get sidebarItemsCO() {
    return new CoUxLayoutSidebarItems(this.overlayPanel);
  }
}


