{"version":3,"file":"RenderUserContentAsHTML.cjs","sources":["../../../../src/components/RenderUserContentAsHTML/RenderUserContentAsHTML.tsx"],"sourcesContent":["import { HTMLAttributes, PropsWithChildren, type JSX } from 'react';\nimport * as React from 'react';\n\nimport { textUtil } from '@grafana/data';\n\nexport interface RenderUserContentAsHTMLProps<T = HTMLSpanElement>\n  extends Omit<HTMLAttributes<T>, 'dangerouslySetInnerHTML'> {\n  component?: keyof React.ReactHTML;\n  content: string;\n}\n\n/**\n * Abstraction layer component for sanitizing and rendering an html content.\n *\n * https://developers.grafana.com/ui/latest/index.html?path=/docs/utilities-renderusercontentashtml--docs\n */\nexport function RenderUserContentAsHTML<T>({\n  component,\n  content,\n  ...rest\n}: PropsWithChildren<RenderUserContentAsHTMLProps<T>>): JSX.Element {\n  return React.createElement(component || 'span', {\n    ...rest,\n    dangerouslySetInnerHTML: { __html: textUtil.sanitize(content) },\n  });\n}\n"],"names":["React","textUtil"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAAS,uBAAA,CAA2B;AAAA,EACzC,SAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAoE;AAClE,EAAA,OAAOA,gBAAA,CAAM,aAAA,CAAc,SAAA,IAAa,MAAA,EAAQ;AAAA,IAC9C,GAAG,IAAA;AAAA,IACH,yBAAyB,EAAE,MAAA,EAAQC,aAAA,CAAS,QAAA,CAAS,OAAO,CAAA;AAAE,GAC/D,CAAA;AACH;;;;"}