"use strict";

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

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

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

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

var _SubrecordDetachButton = _interopRequireDefault(require("../../../styles/cspace-ui/SubrecordDetachButton.css"));

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

const {
  Button
} = _cspaceInput.components;
const messages = (0, _reactIntl.defineMessages)({
  label: {
    "id": "subrecordDetachButton.label",
    "defaultMessage": "Remove"
  }
});
const propTypes = {
  label: _propTypes.default.node,
  onClick: _propTypes.default.func
};
const defaultProps = {
  label: _react.default.createElement(_reactIntl.FormattedMessage, messages.label)
};

function SubrecordDetachButton(props) {
  const {
    label,
    onClick
  } = props;
  return _react.default.createElement(Button, {
    className: _SubrecordDetachButton.default.common,
    icon: true,
    name: "detachSubrecord",
    onClick: onClick
  }, label);
}

SubrecordDetachButton.propTypes = propTypes;
SubrecordDetachButton.defaultProps = defaultProps;