22 lines
781 B
TypeScript
22 lines
781 B
TypeScript
import { RouterProvider } from "@tanstack/react-router";
|
|
|
|
import { ElectronBrowserHost } from "./browser/ElectronBrowserHost";
|
|
import { PreviewAutomationHosts } from "./components/preview/PreviewAutomationHosts";
|
|
import { AppAtomRegistryProvider } from "./rpc/atomRegistry";
|
|
import type { AppRouter } from "./router";
|
|
|
|
/**
|
|
* Owns renderer-wide providers. The Electron browser host intentionally sits
|
|
* outside the router so its webviews survive route transitions, but it must
|
|
* share the same atom registry as routed UI.
|
|
*/
|
|
export function AppRoot({ router }: { readonly router: AppRouter }) {
|
|
return (
|
|
<AppAtomRegistryProvider>
|
|
<RouterProvider router={router} />
|
|
<PreviewAutomationHosts />
|
|
<ElectronBrowserHost />
|
|
</AppAtomRegistryProvider>
|
|
);
|
|
}
|