import { createRoot, hydrateRoot } from 'react-dom/client'
import { RouterProvider } from '@tanstack/react-router'
import { getRouter } from './router'

const router = getRouter()
const rootElement = document.getElementById('root')!

if (rootElement.innerHTML) {
  hydrateRoot(rootElement, <RouterProvider router={router} />)
} else {
  createRoot(rootElement).render(<RouterProvider router={router} />)
}
