'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

require('./style.scss');

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

var HTTPStatus = function HTTPStatus(_ref) {
  var status = _ref.status;

  var theme = '1';
  if (status >= 500) theme = '5';
  if (status >= 400) theme = '4';else if (status >= 300) theme = '3';else if (status >= 200) theme = '2';

  return _react2.default.createElement(
    'code',
    { className: 'HTTPStatus HTTPStatus_' + theme },
    _react2.default.createElement(
      'span',
      { className: 'HTTPStatus-chit', style: { fontSize: '1.3em' } },
      '\u2022'
    ),
    _react2.default.createElement(
      'span',
      { className: 'HTTPStatus-status', style: { padding: 0 } },
      status
    )
  );
};

HTTPStatus.propTypes = process.env.NODE_ENV !== "production" ? {
  status: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string])
} : {};

exports.default = HTTPStatus;
module.exports = exports['default'];