import Component from '../../component.js'
import { elementAttributeContains } from '../../../core/utils.js'
import CoUxTabItem from './ux-tab-item.js'

export default class CoUxTabsBar extends Component {
  constructor(parent) {
    let selector = 'ux-tabs-bar';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-tabs-bar/ux-tabs-bar.component.ts
  }
  get dataE2E() {
    let path = '//div[@data-e2e="ux-tabs-bar"]';
    return this.currentPath + path;
  }
  async isMainNavigation() {
    return await elementAttributeContains(this.dataE2E, 'class', 'ux-tabs--main-navigation');
  }
  get items() {
    let path = '//div[contains(@class,"ux-tabs__items")]';
    return this.dataE2E + path;
  }
  get tabItemCO() {
    return new CoUxTabItem(this.items);
  }
  tabItemByIndex(index) {
    return this.tabItemCO.byIndex(index);
  }
  get rightContent() {
    let path = '//div[contains(@class,"ux-tabs__right-content")]';
    return this.dataE2E + path;
  }
  get uxTabsRightContent() {
    let path = '//uxTabsRightContent';
    return this.rightContent + path;
  }
  get tabContent() {
    let path = '//div[contains(@class, "ux-tab-content")]';
    return this.currentPath + path;
  }
}

  
