import 'react';
import { jsx } from 'react/jsx-runtime';

const isSafeString = content => {
  return typeof content === 'object' && content !== null &&
  // Ensure content is not null
  'toHTML' in content && typeof content.toHTML === 'function';
};

/**
 * React intl doesn't support HTML content in the message props. It would require using a different system for our translations with tags
 * @deprecated This is a temporary function to translate content that is not yet translated in the new system
 * @param content - The rich content to render
 * @returns A React element with the rendered content
 */
function mapLegacyHTMLTranslatedContent(content) {
  return isSafeString(content) ? /*#__PURE__*/jsx(LegacyHTMLTranslatedContent, {
    content: content
  }) : content;
}
function LegacyHTMLTranslatedContent({
  content
}) {
  return /*#__PURE__*/jsx("div", {
    dangerouslySetInnerHTML: {
      __html: content.toHTML()
    }
  });
}

export { LegacyHTMLTranslatedContent, isSafeString, mapLegacyHTMLTranslatedContent };
//# sourceMappingURL=safe-string-handler.jsx.map
