"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = InvokeButton;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _reactIntl = require("react-intl");
var _cspaceInput = require("cspace-input");
var _InvokeButton = _interopRequireDefault(require("../../../styles/cspace-ui/InvokeButton.css"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const {
  Button
} = _cspaceInput.components;
const messages = (0, _reactIntl.defineMessages)({
  label: {
    "id": "invokeButton.label",
    "defaultMessage": "Run"
  }
});
const propTypes = {
  disabled: _propTypes.default.bool,
  isRunning: _propTypes.default.bool,
  recordType: _propTypes.default.string,
  onClick: _propTypes.default.func
};
function InvokeButton(props) {
  const {
    disabled,
    isRunning,
    recordType,
    onClick
  } = props;
  return /*#__PURE__*/_react.default.createElement(Button, {
    className: _InvokeButton.default[recordType],
    disabled: disabled || isRunning,
    icon: true,
    name: "invoke",
    onClick: onClick
  }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.label));
}
InvokeButton.propTypes = propTypes;