import Component  from '../component.js';
import DivComponent from '../div.js';
import AComponent from '../a.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';

export default class CoEuiDashboardCard extends Component {
  constructor(parent) {
    let selector = 'eui-dashboard-card';
    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 externalUrlCO() {
    return new AComponent(this.currentPath).addSelectorPredicate('[@href]');
  }
  async hasExternalUrl() {
    return await (await this.externalUrl.element()).isExisting();
  }
  get urlCO() {
    return new AComponent(this.currentPath).addSelectorPredicate('[not(@href)]');
  }
  async hasUrl() {
    return await (await this.urlCO.element()).isExisting();
  }
  get avatarWrapperCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-dashboard-card__avatar-wrapper');
  }
  async hasAvatarWrapper() {
    return await (await this.avatarWrapperCO.element()).isExisting();
  }
  get euiAvatarCO() {
    return new CoEuiAvatar(this.avatarWrapperCO);
  }
  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 contentWrapperCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-dashboard-card__content-wrapper');
  }
  get labelContentCO() {
    return new DivComponent(this.contentWrapperCO).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.contentWrapperCO).addPredicateClassContains('eui-dashboard-card__sub-content');
  }
}


