"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LoadingWrapper = void 0;

var _react = _interopRequireDefault(require("react"));

var _carbonComponentsReact = require("carbon-components-react");

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

var LoadingWrapper = function LoadingWrapper(_ref) {
  var children = _ref.children,
      text = _ref.text,
      loading = _ref.loading;

  if (loading) {
    return /*#__PURE__*/_react.default.createElement("div", {
      className: "oec-loading-wrapper"
    }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Loading, {
      active: true,
      withOverlay: false
    }), text && /*#__PURE__*/_react.default.createElement("div", null, text));
  }

  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
};

exports.LoadingWrapper = LoadingWrapper;