"use strict";

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

var _hi = require("react-icons/hi");

var _jsxRuntime = require("react/jsx-runtime");

var getSeverity = function getSeverity(incident) {
  switch (incident.severity) {
    case 2:
      return {
        icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_hi.HiOutlineChevronDoubleUp, {
          color: "red"
        }),
        text: "High"
      };

    case 1:
      return {
        icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_hi.HiOutlineChevronUp, {
          color: "red"
        }),
        text: "Medium"
      };

    default:
      return {
        icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_hi.HiOutlineChevronDown, {
          color: "green"
        }),
        text: "Low"
      };
  }
};

function IncidentSeverity(_ref) {
  var incident = _ref.incident,
      iconOnly = _ref.iconOnly;
  var severity = getSeverity(incident);
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
      className: "my-auto",
      children: severity.icon
    }), !iconOnly && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
      className: "leading-5  ml-1.5",
      children: severity.text
    })]
  });
}