import React from 'react'
import { createRoot, hydrateRoot } from 'react-dom/client'
import App from '@/App.jsx'
import { initialLang } from '@/lib/i18n'
import { reusesPrerender } from '@/lib/seo'
import '@/index.css'

const root = document.getElementById('root')

if (reusesPrerender(root.dataset.prerenderedPath, window.location.pathname, initialLang())) {
  hydrateRoot(root, <App />)
} else {
  createRoot(root).render(<App />)
}
