import Component from '../component.js';
import LiComponent from '../li.js';
import PComponent from '../p.js';
import DivComponent from '../div.js';
import CoEuiIconSvg from './eui-icon-svg.js';
import CoEuiLabel from './eui-label.js';
import CoEuiIconState from './eui-icon-state.js';

export default class CoEuiDiscussionThreadItem extends Component {
  constructor(parent) {
    let selector = 'eui-discussion-thread-item';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-discussion-thread/eui-discussion-thread-item.component.html?at=master
  }
  get listItemCO() {
    return LiComponent(this.currentPath).addPredicateClassContains('eui-discussion-thread__item');
  }
  async isOdd() {
    return await (await $(this.listItemCO.currentPath + '/self::li[contains(@class, "eui-discussion-thread-inverted")]')).isExisting();
  }
  get badgeCO() {
    return new DivComponent(this.listItemCO).addPredicateClassContains('eui-discussion-thread__item-badge');
  }
  get iconCO() {
    return new CoEuiIconState(this.badgeCO);
  }
  get panelCO() {
    return new DivComponent(this.listItemCO).addPredicateClassContains('eui-discussion-thread__item-panel');
  }
  get headerCO() {
    return new DivComponent(this.panelCO).addPredicateClassContains('eui-discussion-thread__item-panel-header');
  }
  get headingCO() {
    return new DivComponent(this.headerCO).addPredicateClassContains('eui-discussion-thread__item-panel-heading');
  }
  get titleCO() {
    return new DivComponent(this.headingCO).addPredicateClassContains('eui-discussion-thread__item-panel-title');
  }
  get timeCO() {
    return new DivComponent(this.headingCO).addPredicateClassContains('eui-discussion-thread__item-panel-time');
  }
  get timeIconCO() {
    return new CoEuiIconSvg(this.timeCO);
  }
  get timeLabelCO() {
    return new CoEuiLabel(this.timeCO);
  }
  get subheadingCO() {
    return new DivComponent(this.headerCO).addPredicateClassContains('eui-discussion-thread__item-panel-subheading');
  }
  get bodyCO() {
    return new DivComponent(this.panelCO).addPredicateClassContains('eui-discussion-thread__item-panel-body');
  }
  get wordBreakCO() {
    return PComponent(this.bodyCO).addPredicateClassContains('eui-discussion-thread__item-panel-body-word-break');
  }
}


