import React from "react";
import CssFlex from "../../CssFlex";
import LoadingIcon from "../../Loading";
import makeStyles from "../../styles/makeStyles";
var getClasses = makeStyles({
  root: {
    display: "flex",
    position: "absolute",
    top: "50%",
    left: "50%",
    transform: "translate(-50%, -50%)"
  },
  icon: {
    margin: 0
  }
});

var Loading = function Loading(_ref) {
  var loadingLabel = _ref.loadingLabel;
  var classes = getClasses();
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CssFlex, {
    gap: "sm",
    className: !loadingLabel && classes.root
  }, /*#__PURE__*/React.createElement(LoadingIcon, {
    center: false,
    className: classes.icon,
    size: 24,
    color: "currentColor"
  }), /*#__PURE__*/React.createElement("span", null, loadingLabel)));
};

export default Loading;