"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = TooltipCell;
var _react = _interopRequireDefault(require("react"));
var _useTranslation = require("../hooks/use-translation");
var _truncateWithTooltip = require("../truncate-with-tooltip");
var _tooltip = require("../tooltip");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
 * Adds tooltip for cells with simple string value
 */
function TooltipCell({
  value,
  testId = 'tooltip-cell'
}) {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  const valueText = value == null || value === '' ? t('N/A') : value;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_truncateWithTooltip.TruncateWithTooltip, {
    tooltipPlacement: _tooltip.TOOLTIP_PLACEMENT_TYPES.TOP,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      "test-id": testId,
      children: valueText
    })
  });
}