fix(react/dialogs): some type errors

This commit is contained in:
Elian Doran
2025-08-06 18:38:52 +03:00
parent edd18b53d0
commit bde270b73f
12 changed files with 75 additions and 28 deletions

View File

@@ -1,7 +1,28 @@
interface RawHtmlProps {
html: string;
className?: string;
html: string | HTMLElement;
}
export default function RawHtml({ html }: RawHtmlProps) {
return <span dangerouslySetInnerHTML={{ __html: html }} />;
export default function RawHtml({ className, html }: RawHtmlProps) {
return <span
className={className}
dangerouslySetInnerHTML={getHtml(html)}
/>;
}
export function RawHtmlBlock({ className, html }: RawHtmlProps) {
return <div
className={className}
dangerouslySetInnerHTML={getHtml(html)}
/>
}
function getHtml(html: string | HTMLElement) {
if (typeof html !== "string") {
html = html.outerHTML;
}
return {
__html: html
};
}