'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = RunButton;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactIntl = require('react-intl');

var _cspaceInput = require('cspace-input');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const Button = _cspaceInput.components.Button;


const messages = (0, _reactIntl.defineMessages)({
  label: {
    'id': 'runButton.label',
    'defaultMessage': 'Run'
  }
});

const propTypes = {
  className: _propTypes2.default.string,
  isRunning: _propTypes2.default.bool,
  onClick: _propTypes2.default.func
};

function RunButton(props) {
  const className = props.className,
        isRunning = props.isRunning,
        onClick = props.onClick;


  return _react2.default.createElement(
    Button,
    {
      className: className,
      disabled: isRunning,
      icon: true,
      name: 'run',
      onClick: onClick
    },
    _react2.default.createElement(_reactIntl.FormattedMessage, messages.label)
  );
}

RunButton.propTypes = propTypes;