1import {
2 createRootRoute,
3 HeadContent,
4 Outlet,
5 Scripts,
6} from "@tanstack/react-router";
7import type { ReactNode } from "react";
8// Tailwind is wired through vite.config.ts (@tailwindcss/vite) — Alchemy
9// runs the project's own `vite build`, so the utilities below compile.
10import appCss from "../styles/global.css?url";
11
12export const Route = createRootRoute({
13 head: () => ({
14 meta: [
15 { charSet: "utf-8" },
16 { name: "viewport", content: "width=device-width, initial-scale=1" },
17 { title: "TanStack Start on Neon" },
18 ],
19 links: [{ rel: "stylesheet", href: appCss }],
20 }),
21 component: RootComponent,
22});
23
24function RootComponent() {
25 return (
26 <Document>
27 <Outlet />
28 </Document>
29 );
30}
31
32function Document(props: Readonly<{ children: ReactNode }>) {
33 return (
34 <html lang="en">
35 <head>
36 <HeadContent />
37 </head>
38 <body className="bg-slate-50 p-8 text-slate-900">
39 {props.children}
40 <Scripts />
41 </body>
42 </html>
43 );
44}