import Component from '../component.js'
import { elementAttributeContains } from '../../core/utils.js'
import CoEuiIconSvg from './eui-icon-svg.js';
import SpanComponent from '../span.js';


export default class CoEuiMenuItemIconContent extends Component {
  constructor(parent) {
    super(parent);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-menu/eui-menu-item.component.html
  }
  get notCollapsedIconCO() {
    return new CoEuiIconSvg(this.currentPath).byAttributeNotContains('class', 'eui-menu-item__link-icon--default');
  }
  get notCollapsedLabelCO(){
    return new SpanComponent(this.currentPath).addPredicateClassContains('eui-menu-item__link-icon');
  }
  get itemInitialsLabelCO(){
    return new SpanComponent(this.currentPath).addPredicateClassContains('eui-menu-item__link-initials');
  }
  async hasCollapsedInitials(){
    return await (await this.itemInitialsLabelCO.element()).isExisting();
  }
  async isCollapsed(){
    return await (await this.euiIconSvgNoDefaultCO.element()).isExisting();
  }
  get noInitialIconCO(){
    return new CoEuiIconSvg(this.currentPath).addPredicateAttributeContains('size', 's');
  }
  get euiIconSvgNoDefaultCO() {
    return new CoEuiIconSvg(this.currentPath).addPredicateClassContains('eui-menu-item__link-icon--default');
  }
  get linkIconCO() {
    return new SpanComponent(this.currentPath).addPredicateClassContains('eui-menu-item__link-icon');
  }
  async hasCategoryIconNone() {
    return await elementAttributeContains(this.linkIconCO.currentPath, 'class', 'eui-menu-item__link-icon--none');
  }
}
