"use strict";

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

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

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

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

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

var _BackButton = _interopRequireDefault(require("../../../styles/cspace-ui/BackButton.css"));

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

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

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

BackButton.propTypes = propTypes;
BackButton.defaultProps = defaultProps;