import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { SecurityTokenForm } from '../components/SecurityTokenForm'

const el = document.getElementById('security-token-app')
if (el) {
  createRoot(el).render(
    <StrictMode>
      <SecurityTokenForm
        url={el.dataset.url || ''}
        csrfToken={el.dataset.csrf || ''}
        initialDate={el.dataset.tokenDate || 'Sin solicitar'}
      />
    </StrictMode>,
  )
}
