"use strict";

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

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

var _core = require("@material-ui/core");

var _classnames = _interopRequireDefault(require("classnames"));

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;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: "oec-loading-wrapper"
  }, /*#__PURE__*/_react.default.createElement("div", {
    "aria-hidden": loading,
    className: (0, _classnames.default)({
      'opacity-0': loading
    })
  }, children), /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _classnames.default)('oec-loading-wrapper__indicator', 'bg-white'),
    hidden: !loading
  }, /*#__PURE__*/_react.default.createElement(_core.CircularProgress, {
    className: "indeterminate"
  }), text && /*#__PURE__*/_react.default.createElement("div", null, text)));
};

exports.LoadingWrapper = LoadingWrapper;