import React from 'react';
import { useTranslation } from '../hooks/use-translation';
import { TruncateWithTooltip } from '../truncate-with-tooltip';
import { TOOLTIP_PLACEMENT_TYPES } from '../tooltip';
import { jsx as _jsx } from "react/jsx-runtime";
/**
 * Adds tooltip for cells with simple string value
 */
export default function TooltipCell({
  value,
  testId = 'tooltip-cell'
}) {
  const {
    t
  } = useTranslation();
  const valueText = value == null || value === '' ? t('N/A') : value;
  return /*#__PURE__*/_jsx(TruncateWithTooltip, {
    tooltipPlacement: TOOLTIP_PLACEMENT_TYPES.TOP,
    children: /*#__PURE__*/_jsx("span", {
      "test-id": testId,
      children: valueText
    })
  });
}