import { useEffect, useRef } from 'react'

export function GenerativePageInHtml({ renderedCode }: { renderedCode: string }) {
  const containerRef = useRef<HTMLDivElement>(null)

  useEffect(() => {
    if (containerRef.current) {
      containerRef.current.innerHTML = renderedCode
    }
  }, [renderedCode])

  return (
    <>
      <div ref={containerRef} />
    </>
  )
}
