import Component  from '../component.js';
import AComponent from '../a.js';
import CoEuiDashboardContent from './eui-dashboard-content.js';
import CoEuiDashboardCardContent from './eui-dashboard-card-content.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]');
  }
  get externalContentCO(){
    return new CoEuiDashboardContent(this.externalUrlCO);
  }
  async hasExternalUrl() {
    return await (await this.externalUrl.element()).isExisting();
  }
  get urlCO() {
    return new AComponent(this.currentPath).addSelectorPredicate('[@routerLink]');
  }
  get routerContentCO(){
    return new CoEuiDashboardContent(this.urlCO);
  }
  async hasUrl() {
    return await (await this.urlCO.element()).isExisting();
  }
  get customContentCO(){
    return new CoEuiDashboardCardContent(this.currentPath);
  }
  async hasCustomContent() {
    return await (await this.customContentCO.element()).isExisting();
  }
  get contentCO(){
    return new CoEuiDashboardContent(this.currentPath);
  }
}


