import Component  from '../component.js'
import CoEuiCardHeader from './eui-card-header.js'
import CoEuiCardMedia from './eui-card-media.js'
import CoEuiCardContent from './eui-card-content.js'
import CoEuiCardFooter from './eui-card-footer.js'
import { elementAttributeContains } from '../../core/utils.js'

export default class CoEuiCard extends Component {
  constructor(parent) {
    let selector = 'eui-card';
    super(parent, selector);
    // https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-card/eui-card.component.html?at=support/13.x
  }
  get euiCardHeaderCO() {
    return new CoEuiCardHeader(this.currentPath);
  }
  async hasHeader() {
    return await (await $(this.euiCardHeaderCO.currentPath)).isExisting();
  }
  get euiCardMediaCO() {
    return new CoEuiCardMedia(this.currentPath);
  }
  async hasMedia() {
    return await (await $(this.euiCardMediaCO.currentPath)).isExisting();
  }
  get euiCardContentCO() {
    return new CoEuiCardContent(this.currentPath);
  }
  async hasContent() {
    return await (await $(this.euiCardContentCO.currentPath)).isExisting();
  }
  get euiCardFooterCO() {
    return new CoEuiCardFooter(this.currentPath);
  }
  async hasFooter() {
    return await (await $(this.euiCardFooterCO.currentPath)).isExisting();
  }
  async isCollapsible() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--collapsible');
  }
  async isCollapsed() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--collapsed');
  }
  async isSelected() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--selected');
  }
  async isUrgent() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--urgent');
  }
  async isNoShadow() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--no-shadow');
  }
  async isNoContentPadding() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--no-content-padding');
  }
  async isHoverable() {
    return await elementAttributeContains(this.currentPath, 'class', 'eui-card--hoverable');
  }
}


