'use strict';

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

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 NotificationHeader = function NotificationHeader(props) {
  var title = props.title,
      notificationCount = props.notificationCount,
      selectedNotification = props.selectedNotification,
      children = props.children,
      onBackClicked = props.onBackClicked,
      rest = _objectWithoutProperties(props, ['title', 'notificationCount', 'selectedNotification', 'children', 'onBackClicked']);

  function handlelistViewClicked() {
    onBackClicked();
  }

  var detailView = _react2.default.createElement(
    'div',
    _extends({
      className: 'notificationHeader detailView clearfix',
      onClick: function onClick() {
        return handlelistViewClicked();
      }
    }, rest),
    _react2.default.createElement(_semanticUiReact.Icon, { className: 'angle left backarrow' }),
    _react2.default.createElement(
      'h4',
      { className: 'backbtn' },
      'BACK'
    )
  );
  var listView = _react2.default.createElement(
    'div',
    _extends({ className: 'notificationHeader clearfix' }, rest),
    _react2.default.createElement(
      'h4',
      { className: 'notificationTitle' },
      title
    ),
    notificationCount ? _react2.default.createElement(
      'span',
      { className: 'notificationCount' },
      notificationCount
    ) : null,
    children
  );

  return selectedNotification ? detailView : listView;
};

NotificationHeader.defaultProps = {};

NotificationHeader.propTypes = {};

exports.default = NotificationHeader;
//# sourceMappingURL=NotificationHeader.js.map