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'

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
  }
  get content() {
    return this.currentPath + '//div[contains(@class,"eui-dashboard-button__content")]';
  }
  get mainIcon() {
    return this.content + '//div[contains(@class, "eui-dashboard-button__content-main-icon")]';
  }
  async hasEuiDashboardButtonIcon() {
    return await (await $(this.mainIcon)).isExisting();
  }
  get iconElement() {
    return this.mainIcon + '//div[contains(@class, "eui-dashboard-button__content-icon-element")]';
  }
  get euiDashboardButtonIconCO() {
    return new CoEuiDashboardButtonIcon(this.iconElement);
  }
  get mainLabel() {
    return this.content + '//div[contains(@class, "eui-dashboard-button__content-main-label")]';
  }
  get euiDashboardButtonLabelCO() {
    return new CoEuiDashboardButtonLabel(this.mainLabel);
  }
  get title() {
    return this.content + '//div[contains(@class, "eui-dashboard-button__content-title")]';
  }
  get euiLabelCO() {
    return new CoEuiLabel(this.title);
  }
  get subtitle() {
    return this.content + '//div[contains(@class, "eui-dashboard-button__content-sub-title")]';
  }
  get euiSubLabelCO() {
    return new CoEuiLabel(this.subtitle);
  }
}


