@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, 07:15 UTC

main
jsx 21 lines 726 Bytes
Raw
1 import { getCloudflareContext } from "@opennextjs/cloudflare";
2 import { signGuestbook } from "./actions.js";
3
4 // Server-action mutation path: the form posts to the action, which writes
5 // to KV; this force-dynamic page reads the latest entry back on render.
6 export const dynamic = "force-dynamic";
7
8 export default async function Guestbook() {
9 const { env } = getCloudflareContext();
10 const latest = await env.FIXTURE_KV.get("guestbook:latest");
11 return (
12 <main>
13 <h1>GUESTBOOK_MARKER</h1>
14 <p>guestbook-latest:{latest ?? "empty"}</p>
15 <form action={signGuestbook}>
16 <input type="text" name="name" placeholder="name" />
17 <button type="submit">Sign</button>
18 </form>
19 </main>
20 );
21 }