import type { QueryClient } from '@tanstack/react-query' import { createRootRouteWithContext, HeadContent, Link, Scripts } from '@tanstack/react-router' import type { TRPCOptionsProxy } from '@trpc/tanstack-react-query' import { lazy, Suspense } from 'react' import { siteConfig } from '~/lib/site-config' import type { AppRouter } from '~/server/api/root' import appCss from '../styles.css?url' const Devtools = import.meta.env.DEV ? lazy(() => import('~/components/devtools')) : () => null const themeScript = `(function(){try{var t=localStorage.getItem('theme')||'system';var m=window.matchMedia('(prefers-color-scheme:dark)').matches;document.documentElement.classList.toggle('dark',t==='dark'||(t==='system'&&m));}catch(e){}})();` interface RouterContext { queryClient: QueryClient trpc: TRPCOptionsProxy } export const Route = createRootRouteWithContext()({ head: () => ({ meta: [ { charSet: 'utf-8', }, { name: 'viewport', content: 'width=device-width, initial-scale=1', }, { title: siteConfig.name, }, { name: 'description', content: siteConfig.description, }, ], links: [ { rel: 'stylesheet', href: appCss, }, { rel: 'icon', href: '/favicon.ico', sizes: '32x32', }, { rel: 'icon', href: '/favicon.svg', type: 'image/svg+xml', }, { rel: 'manifest', href: '/manifest.json', }, ], }), notFoundComponent: () => (

404 - Not Found

The page you are looking for does not exist.

Go back home
), shellComponent: RootDocument, }) function RootDocument({ children }: { children: React.ReactNode }) { return ( {/** biome-ignore lint/security/noDangerouslySetInnerHtml: anti-FOUC theme script */}