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

export default class CoEuiTimelineItem extends Component {
  constructor(parent) {
    let selector = 'eui-timeline-item';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-timeline/eui-timeline-item.component.html?at=master
  }
  get itemLeftContentCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-timeline-item__left-content');
  }
  async isNotLeftAligned() {
    return await (await this.itemLeftContentCO.element()).isExisting();
  }
  get itemLeftContentDateCO() {
    return new DivComponent(this.itemLeftContentCO).addPredicateClassContains('eui-timeline-item__date');
  }
  async hasLeftContentDate() {
    return await (await this.itemLeftContentDateCO.element()).isExisting();
  }
  get itemLeftContentTimeCO() {
    return new DivComponent(this.itemLeftContentCO).addPredicateClassContains('eui-timeline-item__time');
  }
  async hasLeftContentTime() {
    return await (await this.itemLeftContentTimeCO.element()).isExisting();
  }
  get itemIconCO() {
    return new SpanComponent(this.currentPath).addPredicateClassContains('eui-timeline-item__icon');
  }
  async isNotGroup() {
    return await (await this.itemIconCO.element()).isExisting();
  }
  get itemContentCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-timeline-item__content');
  }
  get customContentCO() {
    return new DivComponent(this.itemContentCO);
  }
  async hasNoCustomContentChildNodes() {
    return await (await this.contentTitleCO.element()).isExisting();
  }
  get contentTitleCO() {
    return new DivComponent(this.itemContentCO).addPredicateClassContains('eui-timeline-item__title');
  }
  get contentSubtitleCO() {
    return new DivComponent(this.itemContentCO).addPredicateClassContains('eui-timeline-item__subtitle');
  }
  get contentDateCO() {
    return new DivComponent(this.itemContentCO).addPredicateClassContains('eui-timeline-item__date');
  }
  async hasContentDate() {
    return await (await this.contentDateCO.element()).isExisting();
  }
  get contentTimeCO() {
    return new DivComponent(this.customContentCO).addPredicateClassContains('eui-timeline-item__time');
  }
  async hasContentTime() {
    return await (await this.contentTimeCO.element()).isExisting();
  }
}
