"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

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

// Style

/* istanbul ignore next */
if (typeof window !== 'undefined') require("./style.scss");

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 /*#__PURE__*/_react["default"].createElement("code", {
    className: "HTTPStatus HTTPStatus_".concat(theme)
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "HTTPStatus-chit",
    style: {
      fontSize: '1.3em'
    }
  }, "\u2022"), /*#__PURE__*/_react["default"].createElement("span", {
    className: "HTTPStatus-status",
    style: {
      padding: 0
    }
  }, status));
};

HTTPStatus.propTypes = {
  status: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])
};
var _default = HTTPStatus;
exports["default"] = _default;