@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
tsx 28 lines 970 Bytes
Raw
1 import { createFileRoute } from "@tanstack/react-router";
2 import { createServerFn } from "@tanstack/react-start";
3 import { Card } from "../components/Card.tsx";
4 import { env } from "../env.ts";
5
6 // Runs on the server for both the SSR render and client navigations — in
7 // the deployed Worker (or, under `alchemy dev`, in TanStack Start's own
8 // Vite dev server). The `env` declared on the Website in alchemy.run.ts
9 // is available through the `cloudflare:workers` env proxy.
10 const getGreeting = createServerFn({ method: "GET" }).handler(() => env.GREETING ?? "Hello!");
11
12 export const Route = createFileRoute("/")({
13 loader: () => getGreeting(),
14 component: Home,
15 });
16
17 function Home() {
18 const greeting = Route.useLoaderData();
19 return (
20 <main>
21 <h1 className="text-3xl font-bold">{greeting}</h1>
22 <Card
23 title="Styled with Tailwind CSS"
24 body="This card is a React component styled with Tailwind utilities."
25 />
26 </main>
27 );
28 }