import Component from '../../component.js'
import CoUxOverlay from './ux-overlay.js';

export default class CoUxLayoutFooterActionBar extends Component {
    constructor(parent) {
      let selector = 'ux-layout-footer-action-bar';
      super(parent, selector);
      //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/src/lib/ux-components/layout/ux-layout-footer-action-bar/ux-layout-footer-action-bar.component.html?at=support/10.x
    }
    get actionBarWrapper() {
      let path = '//div[contains(@class, "ux-layout-footer-action-bar-wrapper")]';
      return this.currentPath + path;
    }
    get actionBar() {
      let path = '//div[contains(@class, "ux-layout-footer-action-bar")]';
      return this.actionBarWrapper + path;
    }
    get customContent() {
      let path = '//uxLayoutFooterActionBarContent';
      return this.actionBar + path;
    }
    get flexContainer() {
      let path = '//div[contains(@class, "flex-container") and contains(@class, "justify-content-end")]';
      return this.actionBar + path;
    }
    get primaryButton() {
      let path = '//button[contains(@class, "ux-button--primary")]';
      return this.flexContainer + path;
    }
    get secondaryButton() {
      let path = '//button[contains(@class, "ux-button--secondary")]';
      return this.flexContainer + path;
    }
    async isAcceptActionDisabled() {
      return await (await $(this.primaryButton + '/self::*[@disabled]')).isExisting();
      }
      async isDismissActionDisabled() {
      return await (await $(this.secondaryButton+ '/self::*[@disabled]')).isExisting();
    }
    get overlayCO() {
      return new CoUxOverlay(this.currentPath);
    }
    async isActive() {
      return await (await $(this.overlayCO.currentPath + '/self::*[@isEditActive]')).isExisting();
    }
}


