1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { Hono } from "https://esm.sh/hono";
3import { debounce } from "https://esm.sh/lodash-es";
4import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
5import { useDropzone } from "https://esm.sh/react-dropzone?deps=react@18.2.0,react-dom@18.2.0";
6import React, { ReactNode, useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
7import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";
8import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton";
9
10interface TooltipProps {
11 children: ReactNode;
12 content: string;
13}
46 If needed and if the user asks for something that requires persistence, use Val Town SQLite or Blob storage. Use the val's `import.meta.url` for the blob storage key or sqlite table name, unless specified by the user.
47
48 * If you use any React library, use esm.sh and pin its React version to 18.2.0 and its ReactDOM version to 18.2.0 by adding `?deps=react@18.2.0,react-dom@18.2.0` to the end of the URL. If the user is facing a client-side error where nothing is being rendered, check if all React dependencies and sub-dependencies are pinned to the same version, including the @jsxImportSource pragma.
49</requirements>
50
148```val type=http
149/** Use this template when you create http vals only */
150/** @jsxImportSource https://esm.sh/react@18.2.0 */
151import React from "https://esm.sh/react@18.2.0";
152import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
153
154/**
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { ValTown } from "https://esm.sh/@valtown/sdk";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import { generateCodeAnthropic, makeFullPrompt } from "./backend/generateCode";
6
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
3import {
4 createStaticHandler,
5 createStaticRouter,
6 StaticRouterProvider,
7} from "https://esm.sh/react-router@7.1.3?deps=react@18.2.0,react-dom@18.2.0";
8
9import routes from "./routes/_index.ts";
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3export default function Home() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3import { hydrateRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import { RouterProvider } from "https://esm.sh/react-router@7.1.3/dom?deps=react@18.2.0,react-dom@18.2.0";
5import { createBrowserRouter } from "https://esm.sh/react-router@7.1.3?deps=react@18.2.0,react-dom@18.2.0";
6import { StrictMode } from "https://esm.sh/react@18.2.0";
7import routes from "./routes/_index.ts";
8
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { ValTown } from "https://esm.sh/@valtown/sdk";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import { generateCodeAnthropic, makeFullPrompt } from "./backend/generateCode";
6
46 If needed and if the user asks for something that requires persistence, use Val Town SQLite or Blob storage. Use the val's `import.meta.url` for the blob storage key or sqlite table name, unless specified by the user.
47
48 * If you use any React library, use esm.sh and pin its React version to 18.2.0 and its ReactDOM version to 18.2.0 by adding `?deps=react@18.2.0,react-dom@18.2.0` to the end of the URL. If the user is facing a client-side error where nothing is being rendered, check if all React dependencies and sub-dependencies are pinned to the same version, including the @jsxImportSource pragma.
49</requirements>
50
148```val type=http
149/** Use this template when you create http vals only */
150/** @jsxImportSource https://esm.sh/react@18.2.0 */
151import React from "https://esm.sh/react@18.2.0";
152import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
153
154/**
10
11The `www` val serves the site using the `src/hono-adapter`.
12This "adapter" could use any framework for rendering so that you could use something like React or something like Handlebars
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { ValTown } from "https://esm.sh/@valtown/sdk";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import { generateCodeAnthropic, makeFullPrompt } from "./backend/generateCode";
6