2
3import { hc } from "https://esm.sh/hono@4.7.7/client?deps=hono@4.7.7";
4import { QueryClient } from "https://esm.sh/@tanstack/react-query@5.74.7?deps=react@19.0.0";
5import { AppType } from "../backend/api/mod.ts";
6import { APP_URL } from "../shared/consts.ts";
1/** @jsxImportSource ../jsx */
2import { useLoaderData, Outlet } from "https://esm.sh/react-router";
3import * as ident from "../vectors/identicon.tsx";
4
6 "importMap": "import_map.json",
7 "compilerOptions": {
8 "jsx": "react-jsx",
9 "jsxImportSource": "https://esm.sh/preact@10.19.6"
10 },
11 "fmt": {
30 <div id="root"></div>
31
32 <!-- React and ReactDOM from esm.sh (pinned versions as per guidelines) -->
33 <!-- The ?deps=react@18.2.0,react-dom@18.2.0 is important for Val Town compatibility -->
34 <script type="module">
35 import { render, h } from "https://esm.sh/preact@10.19.6";
36 // The main application component will be imported from index.tsx
37 import App from "/frontend/index.tsx"; // Assuming index.tsx is the entry point
41 render(h(App), rootElement);
42 } else {
43 console.error("Root element not found. Preact app cannot be mounted.");
44 }
45 </script>
1/** @jsxImportSource https://esm.sh/preact@10.19.6 */
2import { h, FunctionComponent, JSX } from "https://esm.sh/preact@10.19.6";
3import { User } from "../../shared/types.ts"; // Import User type
4
1/** @jsxImportSource ./jsx */
2import { Hono } from "npm:hono@4";
3import * as React from "https://esm.sh/react@19";
4import ReactDOMServer from "https://esm.sh/react-dom@19/server";
5import {
6 createStaticHandler,
7 createStaticRouter,
8 StaticRouterProvider,
9} from "https://esm.sh/react-router";
10import routes from "./routes/index.tsx";
11
19});
20
21// react app
22app.get("*", async (c) => {
23 const { query, dataRoutes } = createStaticHandler(routes);
25 const router = createStaticRouter(dataRoutes, context);
26
27 let html = await ReactDOMServer.renderToReadableStream(
28 <StaticRouterProvider
29 router={router}
1/** @jsxImportSource https://esm.sh/preact@10.19.6 */
2import { h, FunctionComponent, JSX } from "https://esm.sh/preact@10.19.6";
3
4interface QuickActionsProps {
1import { useState, useEffect } from "react";
2
3const USER_ENDPOINT = "/api/user";
1import { useEffect } from "react";
2
3export function useUsageStats(messages: any[], usages: any[]) {
1import { useEffect, useRef } from 'https://esm.sh/react@18.2.0?dev';
2
3