import React__default, { Fragment } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Button from '../../Button/Button.js';
import { settings } from '../../../constants/Settings.js';

var iotPrefix = settings.iotPrefix;
var propTypes = {
  onNext: PropTypes.func.isRequired,
  onBack: PropTypes.func.isRequired,
  onSubmit: PropTypes.func.isRequired,
  onCancel: PropTypes.func.isRequired,
  backLabel: PropTypes.node.isRequired,
  nextLabel: PropTypes.node.isRequired,
  cancelLabel: PropTypes.node.isRequired,
  submitLabel: PropTypes.node.isRequired,
  hasPrev: PropTypes.bool,
  hasNext: PropTypes.bool,
  footerLeftContent: PropTypes.node,
  nextDisabled: PropTypes.bool,
  sendingData: PropTypes.bool,
  testId: PropTypes.string
};
var defaultProps = {
  footerLeftContent: null,
  nextDisabled: false,
  hasPrev: true,
  hasNext: true,
  sendingData: false,
  testId: 'wizard-footer'
};
var WizardFooter = function WizardFooter(_ref) {
  var onNext = _ref.onNext,
    onBack = _ref.onBack,
    onSubmit = _ref.onSubmit,
    className = _ref.className,
    onCancel = _ref.onCancel,
    cancelLabel = _ref.cancelLabel,
    backLabel = _ref.backLabel,
    nextLabel = _ref.nextLabel,
    submitLabel = _ref.submitLabel,
    hasPrev = _ref.hasPrev,
    hasNext = _ref.hasNext,
    footerLeftContent = _ref.footerLeftContent,
    nextDisabled = _ref.nextDisabled,
    sendingData = _ref.sendingData,
    testId = _ref.testId;
  return /*#__PURE__*/React__default.createElement(Fragment, null, footerLeftContent && /*#__PURE__*/React__default.createElement("div", {
    className: "WizardInline-custom-footer-content"
  }, footerLeftContent), /*#__PURE__*/React__default.createElement("div", {
    "data-testid": testId,
    className: classnames(className, "".concat(iotPrefix, "--wizard-footer__buttons"))
  }, !hasPrev ? /*#__PURE__*/React__default.createElement(Button, {
    onClick: onCancel,
    kind: "secondary"
    // TODO: pass testId in v3 to override defaults
    // testId={`${testId}-cancel-button`}
  }, cancelLabel) : null, hasPrev ? /*#__PURE__*/React__default.createElement(Button, {
    onClick: onBack,
    kind: "secondary"
    // TODO: pass testId in v3 to override defaults
    // testId={`${testId}-previous-button`}
  }, backLabel) : null, hasNext ? /*#__PURE__*/React__default.createElement(Button, {
    onClick: onNext,
    disabled: nextDisabled
    // TODO: pass testId in v3 to override defaults
    // testId={`${testId}-next-button`}
  }, nextLabel) : /*#__PURE__*/React__default.createElement(Button, {
    onClick: onSubmit,
    disabled: nextDisabled,
    loading: sendingData
    // TODO: pass testId in v3 to override defaults
    // testId={`${testId}-submit-button`}
  }, submitLabel)));
};
WizardFooter.propTypes = propTypes;
WizardFooter.defaultProps = defaultProps;
WizardFooter.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "WizardFooter",
  "props": {
    "footerLeftContent": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "node"
      },
      "required": false
    },
    "nextDisabled": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hasPrev": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hasNext": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "sendingData": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "testId": {
      "defaultValue": {
        "value": "'wizard-footer'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "onNext": {
      "description": "",
      "type": {
        "name": "func"
      },
      "required": true
    },
    "onBack": {
      "description": "",
      "type": {
        "name": "func"
      },
      "required": true
    },
    "onSubmit": {
      "description": "",
      "type": {
        "name": "func"
      },
      "required": true
    },
    "onCancel": {
      "description": "",
      "type": {
        "name": "func"
      },
      "required": true
    },
    "backLabel": {
      "description": "",
      "type": {
        "name": "node"
      },
      "required": true
    },
    "nextLabel": {
      "description": "",
      "type": {
        "name": "node"
      },
      "required": true
    },
    "cancelLabel": {
      "description": "",
      "type": {
        "name": "node"
      },
      "required": true
    },
    "submitLabel": {
      "description": "",
      "type": {
        "name": "node"
      },
      "required": true
    }
  }
};
var WizardFooter$1 = WizardFooter;

export { WizardFooter$1 as default };
