import Component  from '../component.js';
import CoEuiDashboardButtonIcon from './eui-dashboard-button-icon.js';
import CoEuiDashboardButtonLabel from './eui-dashboard-button-label.js';
import CoEuiLabel from './eui-label.js';
import DivComponent from '../div.js';
import CoEuiAvatar from './eui-avatar.js';
import CoEuiAvatarIcon from './eui-avatar-icon.js';
import CoEuiAvatarText from './eui-avatar-text.js';
import CoEuiAvatarImage from './eui-avatar-image.js';
import ButtonComponent from '../button.js';

export default class CoEuiDashboardButton extends Component {
  constructor(parent) {
    let selector = 'eui-dashboard-button';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-dashboard-button/eui-dashboard-button.component.html?at=master
  }
  get contentCO() {
    return new ButtonComponent(this.currentPath).addPredicateClassContains('eui-dashboard-button__content');
  }
  get euiAvatarCO() {
    return new CoEuiAvatar(this.contentCO);
  }
  get euiAvatarIconCO() {
    return new CoEuiAvatarIcon(this.euiAvatarCO);
  }
  get euiDashboardButtonIconCO() {
    return new CoEuiDashboardButtonIcon(this.euiAvatarIconCO);
  }
  get euiAvatarTextCO() {
    return new CoEuiAvatarText(this.euiAvatarCO);
  }
  get euiDashboardButtonLabelCO() {
    return new CoEuiDashboardButtonLabel(this.euiAvatarTextCO);
  }
  get euiAvatarImageCO() {
    return new CoEuiAvatarImage(this.euiAvatarCO);
  }
  async hasImageUrl() {
    return await (await this.euiAvatarImageCO.element()).isExisting();
  }
  get contentTitleCO() {
    return new DivComponent(this.contentCO).addPredicateClassContains('eui-dashboard-button__content-title');
  }
  async hasEuiLabelContent() {
    return await (await this.contentTitleCO.element()).isExisting();
  }
  get euiLabelCO() {
    return new CoEuiLabel(this.contentTitleCO);
  }
  get subtitleCO() {
    return new DivComponent(this.contentCO).addPredicateClassContains('eui-dashboard-button__content-sub-title');
  }
  get euiSubLabelCO() {
    return new CoEuiLabel(this.subtitleCO);
  }
}


