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

export default class CoUxTabs extends Component {
  constructor(parent) {
    let selector = 'ux-tabs';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/ux-tab/ux-tab.component.ts
  }
  get dataE2E() {
    let path = '//div[@data-e2e="ux-tabs"]';
    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;
  }
  get tabCO() {
    return new CoUxTab(this.currentPath);
  }
  tabByIndex(index) {
    return this.tabCO.byIndex(index);
  }
}

  
