Liferay.Loader.define("portal-workflow-metrics-web@2.0.42/js/shared/components/modal-with-steps/ModalWithSteps.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/alert', '@frontend-taglib-clay$clayui/button', '@frontend-taglib-clay$clayui/modal', 'frontend-js-react-web$react', '../step-bar/StepBar.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports["default"] = void 0;

    var _alert = _interopRequireDefault(require("@frontend-taglib-clay$clayui/alert"));

    var _button = _interopRequireDefault(require("@frontend-taglib-clay$clayui/button"));

    var _modal = _interopRequireDefault(require("@frontend-taglib-clay$clayui/modal"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    var _StepBar = _interopRequireDefault(require("../step-bar/StepBar.es"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { "default": obj };
    }

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * The contents of this file are subject to the terms of the Liferay Enterprise
     * Subscription License ("License"). You may not use this file except in
     * compliance with the License. You can obtain a copy of the License by
     * contacting Liferay, Inc. See the License for the specific language governing
     * permissions and limitations under the License, including but not limited to
     * distribution rights of the Software.
     */
    var ModalWithSteps = function ModalWithSteps(_ref) {
      var _ref$dataTestId = _ref.dataTestId,
          dataTestId = _ref$dataTestId === void 0 ? 'modalWithSteps' : _ref$dataTestId,
          error = _ref.error,
          _ref$modalSize = _ref.modalSize,
          modalSize = _ref$modalSize === void 0 ? 'lg' : _ref$modalSize,
          observer = _ref.observer,
          step = _ref.step,
          _ref$stepsCount = _ref.stepsCount,
          stepsCount = _ref$stepsCount === void 0 ? 2 : _ref$stepsCount,
          visible = _ref.visible;
      return _react["default"].createElement(_react["default"].Fragment, null, visible && _react["default"].createElement(_modal["default"], {
        "data-testid": dataTestId,
        observer: observer,
        size: modalSize
      }, _react["default"].createElement(_modal["default"].Header, null, step.title), error && _react["default"].createElement(_alert["default"], {
        className: "mb-0",
        "data-testid": "alertError",
        displayType: "danger",
        title: Liferay.Language.get('error')
      }, error), _react["default"].createElement(_StepBar["default"], {
        current: step.order,
        title: step.subtitle,
        total: stepsCount
      }), _react["default"].createElement(step.component, step.props), _react["default"].createElement(_modal["default"].Footer, {
        first: step.cancelBtn && _react["default"].createElement(_button["default"], {
          "data-testid": "cancelButton",
          disabled: step.cancelBtn.disabled,
          displayType: "secondary",
          onClick: step.cancelBtn.handle
        }, Liferay.Language.get('cancel')),
        last: _react["default"].createElement(_react["default"].Fragment, null, step.previousBtn && _react["default"].createElement(_button["default"], {
          className: "mr-3",
          "data-testid": "previousButton",
          disabled: step.previousBtn.disabled,
          displayType: "secondary",
          onClick: step.previousBtn.handle
        }, Liferay.Language.get('previous')), _react["default"].createElement(_button["default"], {
          "data-testid": "nextButton",
          disabled: step.nextBtn.disabled,
          onClick: step.nextBtn.handle
        }, step.nextBtn.text))
      })));
    };

    var _default = ModalWithSteps;
    exports["default"] = _default;
    //# sourceMappingURL=ModalWithSteps.es.js.map
  }
});
//# sourceMappingURL=ModalWithSteps.es.js.map