|
1 | | -import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router' |
2 | | -import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools' |
3 | | -import { TanStackDevtools } from '@tanstack/react-devtools' |
| 1 | +import { |
| 2 | + HeadContent, |
| 3 | + Outlet, |
| 4 | + Scripts, |
| 5 | + createRootRoute, |
| 6 | +} from "@tanstack/react-router"; |
| 7 | +import { TanStackRouterDevtoolsPanel } from "@tanstack/react-router-devtools"; |
| 8 | +import { TanStackDevtools } from "@tanstack/react-devtools"; |
4 | 9 |
|
| 10 | +import { ConvexClerkProvider } from "../lib/convex-clerk"; |
| 11 | +import { ThemeProvider } from "../components/dashboard/ThemeProvider"; |
| 12 | +import { Toaster } from "@/components/ui/sonner"; |
| 13 | +import { MonitoringErrorBoundary } from "@stackdock/monitoring"; |
| 14 | +import { initWebMonitoring } from "../lib/monitoring"; |
| 15 | +import { NotFound } from "../components/NotFound"; |
5 | 16 |
|
6 | | -import { ConvexClerkProvider } from '../lib/convex-clerk' |
7 | | -import { ThemeProvider } from '../components/dashboard/ThemeProvider' |
8 | | -import { Toaster } from '@/components/ui/sonner' |
9 | | -import { MonitoringErrorBoundary } from '@stackdock/monitoring' |
10 | | -import { initWebMonitoring } from '../lib/monitoring' |
11 | | - |
12 | | -import appCss from '../styles.css?url' |
| 17 | +import appCss from "../styles.css?url"; |
13 | 18 |
|
14 | 19 | // Initialize monitoring |
15 | | -initWebMonitoring() |
| 20 | +initWebMonitoring(); |
16 | 21 |
|
17 | 22 | export const Route = createRootRoute({ |
18 | 23 | head: () => ({ |
19 | 24 | meta: [ |
20 | 25 | { |
21 | | - charSet: 'utf-8', |
| 26 | + charSet: "utf-8", |
22 | 27 | }, |
23 | 28 | { |
24 | | - name: 'viewport', |
25 | | - content: 'width=device-width, initial-scale=1', |
| 29 | + name: "viewport", |
| 30 | + content: "width=device-width, initial-scale=1", |
26 | 31 | }, |
27 | 32 | { |
28 | | - title: 'StackDock', |
| 33 | + title: "StackDock", |
29 | 34 | }, |
30 | 35 | ], |
31 | 36 | links: [ |
32 | 37 | { |
33 | | - rel: 'stylesheet', |
| 38 | + rel: "stylesheet", |
34 | 39 | href: appCss, |
35 | 40 | }, |
36 | 41 | ], |
37 | 42 | }), |
38 | | - |
| 43 | + component: RootComponent, |
| 44 | + notFoundComponent: NotFound, |
39 | 45 | shellComponent: RootDocument, |
40 | | -}) |
| 46 | +}); |
| 47 | + |
| 48 | +function RootComponent() { |
| 49 | + return <Outlet />; |
| 50 | +} |
41 | 51 |
|
42 | 52 | function RootDocument({ children }: { children: React.ReactNode }) { |
43 | 53 | const content = ( |
44 | 54 | <> |
45 | 55 | {children} |
46 | 56 | <TanStackDevtools |
47 | 57 | config={{ |
48 | | - position: 'bottom-right', |
| 58 | + position: "bottom-right", |
49 | 59 | }} |
50 | 60 | plugins={[ |
51 | 61 | { |
52 | | - name: 'Tanstack Router', |
| 62 | + name: "Tanstack Router", |
53 | 63 | render: <TanStackRouterDevtoolsPanel />, |
54 | 64 | }, |
55 | 65 | ]} |
56 | 66 | /> |
57 | 67 | <Scripts /> |
58 | 68 | </> |
59 | | - ) |
| 69 | + ); |
60 | 70 |
|
61 | 71 | return ( |
62 | 72 | <html lang="en" suppressHydrationWarning> |
@@ -97,5 +107,5 @@ function RootDocument({ children }: { children: React.ReactNode }) { |
97 | 107 | </ThemeProvider> |
98 | 108 | </body> |
99 | 109 | </html> |
100 | | - ) |
| 110 | + ); |
101 | 111 | } |
0 commit comments