"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.WizardFooterInternal = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactStyles = require("@patternfly/react-styles");
var _wizard = _interopRequireDefault(require("@patternfly/react-styles/css/components/Wizard/wizard"));
var _Button = _interopRequireDefault(require("../../../../spi/Button"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*
 * MIT License
 *
 * Copyright (c) 2019 Red Hat, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
/**
 * Attribution: https://github.com/patternfly/patternfly-react/blob/%40patternfly/react-core%404.202.25/packages/react-core/src/components/Wizard/WizardFooterInternal.tsx
 * Additions by:
 *   - @starpit 20220412 Added `leftActions` and `rightContent` properties
 */

const WizardFooterInternal = ({
  onNext,
  onBack,
  onClose,
  isValid,
  firstStep,
  activeStep,
  nextButtonText,
  backButtonText,
  cancelButtonText,
  boxShadow,
  leftButtons,
  rightButtons,
  topContent
}) => _react.default.createElement("footer", {
  className: (0, _reactStyles.css)(_wizard.default.wizardFooter) + ' kui--wizard-footer',
  "data-has-box-shadow": boxShadow || undefined
}, topContent && _react.default.createElement("span", {
  className: "kui--wizard-footer--top"
}, topContent), _react.default.createElement("span", {
  className: "kui--wizard-footer--bottom"
}, _react.default.createElement("span", {
  className: "kui--wizard-footer--bottom-left"
}, leftButtons && leftButtons.map((_, idx) => _react.default.createElement(_Button.default, Object.assign({
  key: idx
}, _))), _react.default.createElement(_Button.default, {
  variant: "primary",
  type: "submit",
  onClick: onNext,
  isDisabled: !isValid
}, nextButtonText), activeStep && !activeStep.hideBackButton && _react.default.createElement(_Button.default, {
  variant: "secondary",
  onClick: onBack,
  isDisabled: firstStep
}, backButtonText), activeStep && !activeStep.hideCancelButton && _react.default.createElement("div", {
  className: _wizard.default.wizardFooterCancel
}, _react.default.createElement(_Button.default, {
  variant: "link",
  onClick: onClose
}, cancelButtonText))), rightButtons && _react.default.createElement("span", {
  className: "kui--wizard-footer--bottom-right"
}, rightButtons && rightButtons.map((_, idx) => _react.default.createElement(_Button.default, Object.assign({
  key: idx
}, _))))));
exports.WizardFooterInternal = WizardFooterInternal;
WizardFooterInternal.displayName = 'WizardFooterInternal';
var _default = WizardFooterInternal;
exports.default = _default;