/**
 * render-frame.jsx — standalone React entry for Playwright card rendering.
 *
 * Reads card data from window globals injected by NovaCardRenderFrameController
 * and mounts just the NovaCardCanvasPreview component with no editor chrome.
 * The Playwright script screenshots [data-card-canvas] after this mounts.
 */
import React from 'react'
import { createRoot } from 'react-dom/client'
import NovaCardCanvasPreview from './components/nova-cards/NovaCardCanvasPreview'

const card  = window.__NOVA_CARD__  || {}
const fonts = window.__NOVA_CARD_FONTS__ || []

const mount = document.getElementById('card-render-mount')
if (mount) {
  createRoot(mount).render(
    <NovaCardCanvasPreview
      card={card}
      fonts={fonts}
      editable={false}
      renderMode={true}
      className="w-full"
    />,
  )
}
