"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = CancelButton;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reactIntl = require("react-intl");
var _cspaceInput = require("cspace-input");
var _CancelButton = _interopRequireDefault(require("../../../styles/cspace-ui/CancelButton.css"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const {
  Button
} = _cspaceInput.components;
const messages = (0, _reactIntl.defineMessages)({
  label: {
    "id": "cancelButton.label",
    "defaultMessage": "Cancel"
  }
});
const propTypes = {
  disabled: _propTypes.default.bool,
  label: _propTypes.default.node,
  onClick: _propTypes.default.func
};
function CancelButton(props) {
  const {
    disabled,
    onClick
  } = props;
  let {
    label
  } = props;
  if (!label) {
    label = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.label);
  }
  return /*#__PURE__*/_react.default.createElement(Button, {
    className: _CancelButton.default.common,
    disabled: disabled,
    icon: true,
    name: "cancel",
    onClick: onClick
  }, label);
}
CancelButton.propTypes = propTypes;