import Component  from '../component.js'

export default class CoUxAlabel extends Component {
    constructor(parent) {
      let selector = 'div[@data-e2e="ux-a-label"]';
      super(parent, selector);
    }
    async isDisabled() {
      let cl = await (await this.element()).getAttribute('class');
      if (cl.includes('ux-a-label--disabled')) {
         return true;
      } else {
         return false;
      }
    }
    get markerCO() {
      return new CoUxAmarker(this.currentPath);
    }
    get iconCO() {
      return new CoUxAicon(this.currentPath);
    }
    get labelContent() {
      let path = '//div[contains(@class,"ux-a-label__content")]';
      return this.currentPath + path;
    }
    get labelContentLabel() {
      let path = '//div[contains(@class,"ux-a-label__label")]/span';
      return this.labelContent + path;
    }
    get clickableLink() {
      let path = '//a';
      return this.labelContentLabel + path;
    }
    async isClickable() {
      let cl = await (await $(this.labelContentLabel)).getAttribute('class');
      if (cl.includes('ux-a-label__label--clickable')) {
         return true;
      } else {
         return false;
      }
    }
    get notClickableLabel() {
      return (this.labelContentLabel + '//span');
    }
    get customLabel() {
      let path = '//div[contains(@class,"ux-a-label__custom-label")]';
      return this.labelContent + path;
    }
    get customSubLabel() {
      let path = '//div[contains(@class,"ux-a-label__sub-label")]';
      return this.labelContent + path;
    }
    get badgeCO() {
      return new CoUxBadge(this.currentPath);
    }
    get infos() {
      let path = '//div[contains(@class,"ux-a-label__label-infos")]';
      return this.currentPath + path;
    }
}


