import Component from '../component.js'
import { elementAttributeContains } from '../../core/utils.js'
import CoEuiIconSvg from './eui-icon-svg.js';
import CoEuiBadge from './eui-badge.js';
import CoEuiButton from './eui-button.js';
import CoEuiIconButton from './eui-icon-button.js';


export default class CoEuiMenuItemEndContent 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 badgeCO() {
    return new CoEuiBadge(this.currentPath);
  }
  async hasCollapsedBadge() {
    return await elementAttributeContains(this.badgeCO.currentPath, 'class', 'eui-menu-item__link-dotted-badge');
  }
  get buttonCO() {
    return new CoEuiButton(this.currentPath).addPredicateClassContains('eui-menu-item__link-action-icon');
  }
  async isButtonDisabled() {
    return await (await $(this.urlLinkCO.currentPath + '/self::*[@euiDisabled]')).isExisting();
  }
  get buttonIconCO() {
    return new CoEuiIconSvg(this.buttonCO);
  }
  get expandIconCO() {
    return new CoEuiIconButton(this.currentPath);
  }
  async iconIsExpanded() {
    return await elementAttributeContains(this.expandIconCO.currentPath, 'icon', 'chevron-up');
  }
}
