import EuiBasePage from '../eui-base.po.js'
import CoUxDiscussionThread from '../../../../components/10x/ux/ux-discussion-thread.js'
import CoUxDiscussionThreadItem from '../../../../components/10x/ux/ux-discussion-thread-item.js'
import ModalPage from '../../../../pages/eui/10x/ux/ux-modal-10x.po.js'

export default class DiscussionThreadPage extends EuiBasePage {
  constructor() {
      super();
  }
  get modalCo() {
    return new ModalPage;
  }
  get modalThreadCO() {
    return new CoUxDiscussionThread(this.modalCo.modalByIndex(1));
  }
  threadByIndex(index) {
    let thread =  new CoUxDiscussionThread(this.mainContent);
    return thread.byIndex(index);
  }
   threadItemByIndex(index) {
    let threadItem =  new CoUxDiscussionThreadItem(this.mainContent);
    return threadItem.byIndex(index);
  }
  threadByTextContains(text) {
    let thread = new CoUxDiscussionThread(this.mainContent);
    return thread.byTextContains(text);
  }
  threadItemByTextContains(text) {
      let threadItem = new CoUxDiscussionThreadItem(this.mainContent);
      return threadItem.byTextContains(text);
  }
  threadByTextEqualsAndIndex(text, index, normalize=true) {
    let thread = new CoUxDiscussionThread(this.mainContent);
    return thread.byTextEqualsAndIndex(text, index, normalize);
  }
  threadItemByTextEqualsAndIndex(text, index, normalize=true) {
    let threadItem = new CoUxDiscussionThreadItem(this.mainContent);
    return threadItem.byTextEqualsAndIndex(text, index, normalize);
  }
  threadFromSectionById(id) {
    return new CoUxDiscussionThread(this.sectionById(id));
  }
  threadItemFromSectionById(id) {
    return new CoUxDiscussionThreadItem(this.sectionById(id));
  }
  threadFromSectionWithIdByIndex(id, index) {
    const thread = new CoUxDiscussionThread(this.sectionById(id));
    return thread.byIndex(index);
  }
  threadItemFromSectionWithIdByIndex(id, index) {
    const threadItem = new CoUxDiscussionThreadItem(this.sectionById(id));
    return threadItem.byIndex(index);
  }
}


