import React from 'react';
import PropTypes from 'prop-types';
import './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 React.createElement(
    'code',
    { className: 'HTTPStatus HTTPStatus_' + theme },
    React.createElement(
      'span',
      { className: 'HTTPStatus-chit', style: { fontSize: '1.3em' } },
      '\u2022'
    ),
    React.createElement(
      'span',
      { className: 'HTTPStatus-status', style: { padding: 0 } },
      status
    )
  );
};

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

export default HTTPStatus;