import Component  from '../component.js'
import CoEuiDiscussionThreadItem from './eui-discussion-thread-item.js'
import UlComponent from '../ul.js'

export default class CoEuiDiscussionThread extends Component {
  constructor(parent) {
    let selector = 'eui-discussion-thread';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-discussion-thread/eui-discussion-thread.component.html
  }
  get wrapper() {
    return this.currentPath + '//div[contains(@class,"eui-discussion-thread-wrapper")]';
  }
  get sectionTitle() {
    return this.wrapper + '//div[contains(@class,"section-title")]';
  }
  get sectionSubTitle() {
    return this.wrapper + '//div[contains(@class,"section-sub-title")]';
  }
  get listCO() {
    return UlComponent(this.wrapper);
  }
  async hasItems() {
    return await (await this.discussionThreadItemCO.element()).isExisting();
  }
  get discussionThreadItemCO(){
    return new CoEuiDiscussionThreadItem(this.listCO);
  }
}


