"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.LabelAccent = LabelAccent;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** A label that would come in handy in cases when we need a highlighted label */
function LabelAccent({
  recommended,
  suggested,
  failed,
  info,
  label,
  recommendedText: recommendedTextParams,
  suggestedText: suggestedTextParams,
  failedText: failedTextParams,
  infoText: infoTextParams
}) {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  const recommendedText = recommendedTextParams ?? t('recommended');
  const suggestedText = suggestedTextParams ?? t('suggested');
  const failedText = failedTextParams ?? t('failed');
  const infoText = infoTextParams ?? t('info');
  const classNames = (0, _classnames.default)('label-accent', {
    recommended,
    success: suggested,
    error: failed,
    info
  });
  const testIds = (0, _classnames.default)({
    recommended,
    success: suggested,
    error: failed,
    info
  });
  const getLabel = () => {
    return recommended && recommendedText || suggested && suggestedText || failed && failedText || info && infoText;
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
    "test-id": `label-accent-${testIds}`,
    className: classNames,
    children: label || getLabel()
  });
}