import Component from '../../component.js';
import DivComponent from '../div.js';
import SpanComponent from '../span.js';
import StrongComponent from '../strong.js';

export default class CoEuiTimebarLegendItem extends Component {
  constructor(parent) {
    let selector = 'div[contains(@class, "eui-timebar__legend-item")]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-timebar/eui-timebar.component.html?at=master
  }
  get itemIconCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-timebar__legend-item-icon');
  }
  get circleIconCO() {
    return new SpanComponent(this.currentDateMarker).addPredicateClassContains('ux-icon-circle');
  }
  get indexWrapperCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-timebar__legend-item-index-wrapper');
  }
  async isShowLegendAsIndexGenerated() {
    return await (await $(this.indexWrapperCO.currentPath)).isExisting();
  }
  get itemLabelCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-timebar__legend-item-label');
  }
  get strongLabel() {
    return new StrongComponent(this.itemLabelCO);
  }
}

