'use strict';

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

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _immutable = require('immutable');

var _immutable2 = _interopRequireDefault(_immutable);

var _CloneButton = require('./CloneButton');

var _CloneButton2 = _interopRequireDefault(_CloneButton);

var _SaveButton = require('./SaveButton');

var _SaveButton2 = _interopRequireDefault(_SaveButton);

var _RevertButton = require('./RevertButton');

var _RevertButton2 = _interopRequireDefault(_RevertButton);

var _DeleteButton = require('./DeleteButton');

var _DeleteButton2 = _interopRequireDefault(_DeleteButton);

var _ButtonBar = require('../../../styles/cspace-ui/ButtonBar.css');

var _ButtonBar2 = _interopRequireDefault(_ButtonBar);

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

var propTypes = {
  csid: _propTypes2.default.string,
  isModified: _propTypes2.default.bool,
  isSavePending: _propTypes2.default.bool,
  validationErrors: _propTypes2.default.instanceOf(_immutable2.default.Map),
  onCloneButtonClick: _propTypes2.default.func,
  onDeleteButtonClick: _propTypes2.default.func,
  onRevertButtonClick: _propTypes2.default.func,
  onSaveButtonClick: _propTypes2.default.func,
  onSaveButtonErrorBadgeClick: _propTypes2.default.func
};

function RecordButtonBar(props) {
  var csid = props.csid,
      isModified = props.isModified,
      isSavePending = props.isSavePending,
      validationErrors = props.validationErrors,
      onCloneButtonClick = props.onCloneButtonClick,
      onDeleteButtonClick = props.onDeleteButtonClick,
      onRevertButtonClick = props.onRevertButtonClick,
      onSaveButtonClick = props.onSaveButtonClick,
      onSaveButtonErrorBadgeClick = props.onSaveButtonErrorBadgeClick;


  return _react2.default.createElement(
    'div',
    { className: _ButtonBar2.default.common },
    _react2.default.createElement(_SaveButton2.default, {
      isModified: isModified,
      isSavePending: isSavePending,
      validationErrors: validationErrors,
      onClick: onSaveButtonClick,
      onErrorBadgeClick: onSaveButtonErrorBadgeClick
    }),
    _react2.default.createElement(_CloneButton2.default, {
      csid: csid,
      isModified: isModified,
      isSavePending: isSavePending,
      onClick: onCloneButtonClick
    }),
    _react2.default.createElement(_RevertButton2.default, {
      isModified: isModified,
      isSavePending: isSavePending,
      onClick: onRevertButtonClick
    }),
    _react2.default.createElement(_DeleteButton2.default, {
      csid: csid,
      isSavePending: isSavePending,
      onClick: onDeleteButtonClick
    })
  );
}

RecordButtonBar.propTypes = propTypes;