import Component  from '../component.js';
import CoEuiDiscussionThreadItem from './eui-discussion-thread-item.js';
import UlComponent from '../ul.js';
import DivComponent from '../div.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?at=master
  }
  get wrapperCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-discussion-thread-wrapper');
  }
  get headerCO() {
    return new DivComponent(this.wrapperCO).addPredicateClassContains('eui-discussion-thread-wrapper-header');
  }
  get headerTitleCO() {
    return new DivComponent(this.headerCO).addPredicateClassContains('eui-discussion-thread-wrapper-header__title');
  }
  get headerSubTitleCO() {
    return new DivComponent(this.headerCO).addPredicateClassContains('eui-discussion-thread-wrapper-header__subtitle');
  }
  get listCO() {
    return UlComponent(this.wrapperCO);
  }
  async hasItems() {
    return await (await this.discussionThreadItemCO.element()).isExisting();
  }
  get discussionThreadItemCO(){
    return new CoEuiDiscussionThreadItem(this.listCO);
  }
}


