import Component from '../../component.js'

export default class CoUxAicon extends Component {
    constructor(parent) {
      let selector = 'ux-a-icon';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/atomic/ux-a-icon/ux-a-icon.component.html?at=support/10.x
    }
    get iconContent() {
      let path = '//div[@data-e2e="ux-a-icon"]';
      return this.currentPath + path;
    }
    get iconSymbol() {
      let path = '//span[contains(@class, "ux-a-icon__icon")]';
      return this.iconContent + path;
    }
    get iconTag() {
      let path = '//span[contains(@class,"ux-a-icon__tag")]';
      return this.iconSymbol + path;
    }
    get tagLabel() {
      let path = '//span';
      return this.iconTag + path;
    }
    async isRounded() {
      let cl = await (await $(this.iconContent)).getAttribute('class');
      if (await cl.includes('ux-a-icon--rounded')) {
         return true;
      } else {
         return false;
      }
    }
    async isHoverable() {
      let cl = await (await $(this.iconContent)).getAttribute('class');
      if (await cl.includes('ux-a-icon--hoverable')) {
         return true;
      } else {
         return false;
      }
    }
    async isTiny() {
      let cl = await (await $(this.iconContent)).getAttribute('class');
      if (await cl.includes('ux-a-icon--rounded-tiny')) {
         return true;
      } else {
         return false;
      }
    }
    async isSmall() {
      let cl = await (await $(this.iconContent)).getAttribute('class');
      if (await cl.includes('ux-a-icon--rounded-small')) {
         return true;
      } else {
         return false;
      }
    }
    async isLarge(){
      let cl = await (await $(this.iconContent)).getAttribute('class');
      if (await cl.includes('ux-a-icon--rounded-large')) {
         return true;
      } else {
         return false;
      }
    }
    async isHoverable(){
      let cl = await (await $(this.iconContent)).getAttribute('class');
      if (await cl.includes('ux-a-icon--hoverable')) {
         return true;
      } else {
         return false;
      }
    }
    async isShowTag(){
      let existing = await (await $(this.iconTag)).isExisting();
      if (existing) {
         return true;
      } else {
         return false;
      }
    }
    async isEmptyTag() {
      let cl = await (await $(this.iconTag)).getAttribute('class');
      if (await cl.includes('ux-a-icon__tag--empty')) {
         return true;
      } else {
         return false;
      }
    }

}


