import React from "react";
import { connect } from "../../../redux";
import { getUi } from "../../../selectors";
import { IconButton } from "@webiny/ui/Button";
import { Tooltip } from "@webiny/ui/Tooltip";
import { ReactComponent as SaveIcon } from "@svgr/webpack!../../../assets/icons/baseline-cloud_upload-24px.svg";
import { ReactComponent as SavedIcon } from "@svgr/webpack!../../../assets/icons/baseline-cloud_done-24px.svg";

var Saving = function Saving(_ref) {
  var saving = _ref.saving;

  if (!saving) {
    return /*#__PURE__*/React.createElement(Tooltip, {
      placement: "right",
      content: /*#__PURE__*/React.createElement("span", null, "All changes saved")
    }, /*#__PURE__*/React.createElement(IconButton, {
      icon: /*#__PURE__*/React.createElement(SavedIcon, null)
    }));
  }

  return /*#__PURE__*/React.createElement(Tooltip, {
    placement: "right",
    content: /*#__PURE__*/React.createElement("span", null, "Saving changes ...")
  }, /*#__PURE__*/React.createElement(IconButton, {
    icon: /*#__PURE__*/React.createElement(SaveIcon, null)
  }));
};

export default connect(function (state) {
  return {
    saving: getUi(state).saving || false
  };
})(Saving);
//# sourceMappingURL=Saving.js.map