import CoEuiButton from './eui-button.js'
import CoEuiLabel from './eui-label.js'
import CoEuiIconSvg from './eui-icon-svg.js'
import Component  from '../component.js'

export default class CoEuiBreadcrumbItem extends Component {
  constructor(parent) {
    let selector = 'eui-breadcrumb-item';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/layout/eui-breadcrumb/item/breadcrumb-item.component.html
  }
  get separator(){
    return this.currentPath + '//div[contains(@class, "eui-breadcrumb-item__separator")]';
  }
  async hasPrevious(){
    return await (await $(this.separator)).isExisting();
  }
  get separatorIconCO(){
    return new CoEuiIconSvg(this.separator);
  }
  get linkButtonCO(){
    return new CoEuiButton(this.currentPath);
  }
  async hasLink(){
    return await(await this.linkButtonCO.element()).isExisting();
  }
  get noLinkLabelCO(){
    return new CoEuiLabel(this.currentPath);
  }
}


