import Component  from '../component.js';
import DivComponent from '../div.js';
import CoEuiIconSvg from './eui-icon-svg.js';
import CoEuiAvatarIcon from './eui-avatar-icon.js';
import CoEuiAvatarText from './eui-avatar-text.js';
import CoEuiAvatarImage from './eui-avatar-image.js';
import CoEuiLabel from './eui-label.js';
import CoEuiAvatar from './eui-avatar.js';

export default class CoEuiDashboardContent extends Component {
  constructor(parent) {
    let selector = 'div[contains(@class, "eui-dashboard-card__") and contains(@class, "-wrapper")]';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-dashboard-card/eui-dashboard-card.component.html?at=master
  }
  get euiAvatarCO() {
    return new CoEuiAvatar(this.currentPath);
  }
  async hasAvatarWrapper() {
    return await (await this.euiAvatarCO.element()).isExisting();
  }
  get euiAvatarIconCO() {
    return new CoEuiAvatarIcon(this.euiAvatarCO);
  }
  get euiIconSvgCO() {
    return new CoEuiIconSvg(this.euiAvatarIconCO);
  }
  async hasIconSvgName() {
    return await (await this.euiIconSvgCO.element()).isExisting();
  }
  get euiAvatarImageCO() {
    return new CoEuiAvatarImage(this.euiAvatarCO);
  }
  async hasImageUrl() {
    return await (await this.euiAvatarImageCO.element()).isExisting();
  }
  get euiAvatarTextCO() {
    return new CoEuiAvatarText(this.euiAvatarCO);
  }
  async hasIconLabel() {
    return await (await this.euiAvatarTextCO.element()).isExisting();
  }
  get labelContentCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-dashboard-card__label-content');
  }
  async hasLabelContent() {
    return await (await this.labelContentCO.element()).isExisting();
  }
  get euiLabelCO() {
    return new CoEuiLabel(this.labelContentCO);
  }
  get cardLabelCO() {
    return new CoEuiLabel(this.euiLabelCO).addPredicateClassContains('eui-dashboard-card__label');
  }
  get cardSublabelCO() {
    return new CoEuiLabel(this.euiLabelCO).addPredicateClassContains('eui-dashboard-card__sublabel');
  }
  async hasSublabel() {
    return await (await this.cardSublabelCO.element()).isExisting();
  }
  get subContentCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-dashboard-card__sub-content');
  }
}


