1/** @jsxImportSource https://esm.sh/react */
2import OpenAI from "npm:openai";
3import { renderToString } from "npm:react-dom/server";
4
5// This uses by personal API key, you'll need to provide your own if
1/** @jsxImportSource https://esm.sh/react */
2import { Hono } from "npm:hono@3";
3import OpenAI from "npm:openai";
4import { renderToString } from "npm:react-dom/server";
5
6const jsxResponse = (jsx) => {
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4import valTownBadge from "https://esm.town/v/jxnblk/valTownBadge?v=16";
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2
3let linkClass = "text-sky-600 hover:text-sky-500";
1/** @jsxImportSource https://esm.sh/react@18.2.0 **/
2// Make sure to only import from esm.sh (npm: specifier are not supported in the browser)
3import ReactDOM from "https://esm.sh/react-dom@18.2.0";
4import React from "https://esm.sh/react@18.2.0";
5import { useState } from "https://esm.sh/react@18.2.0";
6import { Tldraw } from "https://esm.sh/tldraw@2.1.0";
7// import "https://esm.sh/tldraw/tldraw.css";
18
19// The app will be rendered inside the root div
20const root = ReactDOM.createRoot(document.getElementById("root"));
21root.render(<App />);
1/** @jsxImportSource https://esm.sh/react */
2import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
3import { blob } from "https://esm.town/v/std/blob?v=12";
5import { createHash } from "node:crypto";
6import base32Encode from "npm:base32-encode";
7import { renderToString } from "npm:react-dom/server";
8
9// Uncomment to run migrations
1/** @jsxImportSource https://esm.sh/react */
2import React from "https://esm.sh/react";
3
4// fresh_charts expects React to be available on globalThis/window, not sure why!
5globalThis.React = React;
6import { Chart, renderChart } from "https://deno.land/x/fresh_charts/mod.ts";
7import { ChartColors, transparentize } from "https://deno.land/x/fresh_charts/utils.ts";
8import { renderToString } from "npm:react-dom/server";
9
10const chart = () => ({
1/** @jsxImportSource https://esm.sh/react */
2import { DateTime } from "https://cdn.skypack.dev/luxon@2.3.2";
3import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
4import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
5import { renderToString } from "npm:react-dom/server";
6
7const { author, name, httpEndpoint } = extractValInfo(import.meta.url);
8
9```tsx
10/** @jsxImportSource https://esm.sh/react */
11import { renderToString } from "npm:react-dom/server";
12
13export default async function(req: Request): Promise<Response> {
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3
4// dprint-ignore