'use strict';

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

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _flexboxReact = require('flexbox-react');

var _flexboxReact2 = _interopRequireDefault(_flexboxReact);

require('../../styles/components/tag-button.css');

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

var TagButton = function TagButton(props) {
  var tagClass = 'octagon tagContainer';
  if (props.selectedTagId === props.tag.id) {
    tagClass = 'selectedTagContainer';
  }
  if (props.tag.filterOption === '') {
    return _react2.default.createElement(
      _flexboxReact2.default,
      { width: '100%' },
      _react2.default.createElement(
        _flexboxReact2.default,
        {
          key: props.tag.id,
          flexDirection: 'row',
          height: '30px',
          className: tagClass + ' ',
          marginBottom: '5px',
          onClick: function onClick() {
            props.closeNotificationDetailView();
            props.getNotificationByTag(props.tag.filterOption);
            props.setActiveTag(props.tag.id);
          }
        },
        _react2.default.createElement(
          _flexboxReact2.default,
          { className: 'tagContainerMiddleAll', alignItems: 'center' },
          props.tag.name
        )
      )
    );
  } else {
    return _react2.default.createElement(
      _flexboxReact2.default,
      {
        key: props.tag.id,
        flexDirection: 'row',
        height: '30px',
        className: '' + tagClass,
        marginBottom: '5px',
        onClick: function onClick() {
          props.closeNotificationDetailView();
          props.getNotificationByTag(props.tag.filterOption);
          props.setActiveTag(props.tag.id);
        }
      },
      _react2.default.createElement(
        _flexboxReact2.default,
        { alignItems: 'center', className: 'tagContainerValue' },
        props.tag.count
      ),
      _react2.default.createElement(
        _flexboxReact2.default,
        {
          className: 'tagContainerMiddle',
          justifyContent: 'center',
          alignItems: 'center'
        },
        props.tag.name
      ),
      _react2.default.createElement(
        _flexboxReact2.default,
        { className: 'tagArrow' },
        _react2.default.createElement('div', null)
      )
    );
  }
};

TagButton.defaultProps = {
  tag: {}
};

TagButton.propTypes = {
  tag: _propTypes2.default.object
};
exports.default = TagButton;
//# sourceMappingURL=TagButton.js.map