import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { Outlet, Link, createRootRouteWithContext, useRouter, HeadContent, Scripts, } from "@tanstack/react-router"; import { useEffect, type ReactNode } from "react"; import appCss from "../styles.css?url"; import { reportLovableError } from "../lib/lovable-error-reporting"; function NotFoundComponent() { return (

404

Page not found

The page you're looking for doesn't exist or has been moved.

Go home
); } function ErrorComponent({ error, reset }: { error: Error; reset: () => void }) { console.error(error); const router = useRouter(); useEffect(() => { reportLovableError(error, { boundary: "tanstack_root_error_component" }); }, [error]); return (

This page didn't load

Something went wrong on our end. You can try refreshing or head back home.

Go home
); } export const Route = createRootRouteWithContext<{ queryClient: QueryClient }>()({ head: () => ({ meta: [ { charSet: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1" }, { title: "Imageboard Grabber" }, { name: "description", content: "Search booru-style imageboards, browse thumbnails, and batch-download posts as ZIP.", }, { property: "og:title", content: "Imageboard Grabber" }, { property: "og:description", content: "Search booru-style imageboards, browse thumbnails, and batch-download posts as ZIP.", }, { property: "og:type", content: "website" }, { name: "twitter:card", content: "summary_large_image" }, ], links: [ { rel: "stylesheet", href: appCss, }, { rel: "icon", href: "/favicon.ico", type: "image/x-icon" }, ], }), shellComponent: RootShell, component: RootComponent, notFoundComponent: NotFoundComponent, errorComponent: ErrorComponent, }); function RootShell({ children }: { children: ReactNode }) { return ( {children} ); } function RootComponent() { const { queryClient } = Route.useRouteContext(); return ( {/* Required: nested routes render here. Removing breaks all child routes. */} ); }