'use strict';

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

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _semanticUiReact = require('semantic-ui-react');

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

var RemovableLabel = function RemovableLabel(props) {
  var children = props.children,
      _props$className = props.className,
      className = _props$className === undefined ? '' : _props$className,
      content = props.content,
      onRemove = props.onRemove,
      otherProps = _objectWithoutProperties(props, ['children', 'className', 'content', 'onRemove']);

  return _react2.default.createElement(
    _semanticUiReact.Label,
    _extends({ className: 'removable ' + className }, otherProps),
    _react2.default.createElement(
      'div',
      { className: 'removable-label-icon', onClick: onRemove },
      _react2.default.createElement(_semanticUiReact.Icon, { className: 'clear', size: 'big' })
    ),
    _react2.default.createElement(
      'span',
      { className: 'removable-label-content' },
      children || content
    )
  );
};
exports.RemovableLabel = RemovableLabel;