import { useEffect, useRef } from "react"; export function IsolatedContent({ html }: { html: string }) { const containerRef = useRef(null); useEffect(() => { if (containerRef.current) { let shadow = containerRef.current.shadowRoot; if (!shadow) { shadow = containerRef.current.attachShadow({ mode: "open" }); } const styleTag = ` `; shadow.innerHTML = `${styleTag}
${html || "Không có nội dung."}
`; } }, [html]); return
; }