mirror of
https://github.com/getredash/redash.git
synced 2026-03-23 04:00:09 -04:00
23 lines
479 B
JavaScript
23 lines
479 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
import sanitize from "@/services/sanitize";
|
|
|
|
const HtmlContent = React.memo(function HtmlContent({ children, ...props }) {
|
|
return (
|
|
<div
|
|
{...props}
|
|
dangerouslySetInnerHTML={{ __html: sanitize(children) }} // eslint-disable-line react/no-danger
|
|
/>
|
|
);
|
|
});
|
|
|
|
HtmlContent.propTypes = {
|
|
children: PropTypes.string,
|
|
};
|
|
|
|
HtmlContent.defaultProps = {
|
|
children: "",
|
|
};
|
|
|
|
export default HtmlContent;
|