import { createRouter, RouterProvider } from "@tanstack/react-router"
import { ReactManagedRuntime } from "effect-fc"
import { StrictMode } from "react"
import { createRoot } from "react-dom/client"
import { routeTree } from "./routeTree.gen"
import { runtime } from "./runtime"


const router = createRouter({ routeTree })

declare module "@tanstack/react-router" {
    interface Register {
        router: typeof router
    }
}

createRoot(document.getElementById("root")!).render(
    <StrictMode>
        <ReactManagedRuntime.Provider runtime={runtime}>
            <RouterProvider router={router} />
        </ReactManagedRuntime.Provider>
    </StrictMode>
)
