1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
3import React, { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
4import { useChatLogic } from "../hooks/useChatLogic.ts";
5import { useProjectFiles } from "../hooks/useProjectFiles.ts";
64
65 // Handle drag events for the entire page
66 const handleDragEnter = (e: React.DragEvent) => {
67 e.preventDefault();
68 e.stopPropagation();
70 };
71
72 const handleDragLeave = (e: React.DragEvent) => {
73 e.preventDefault();
74 e.stopPropagation();
83 };
84
85 const handleDragOver = (e: React.DragEvent) => {
86 e.preventDefault();
87 e.stopPropagation();
88 };
89
90 const handleDrop = (e: React.DragEvent) => {
91 e.preventDefault();
92 e.stopPropagation();
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { MessageItem } from "./MessageItem.tsx";
4import { ErrorDisplay } from "./ErrorDisplay.tsx";
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useState, useEffect, useRef } from "https://esm.sh/react@18.2.0?dev";
3import { ImageUpload, processFiles } from "./ImageUpload.tsx";
4
5interface ChatInputProps {
6 input: string;
7 handleInputChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
8 handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
9 running: boolean;
10 images: (string | null)[];
11 setImages: React.Dispatch<React.SetStateAction<(string | null)[]>>;
12 isDragging: boolean;
13}
41 }, []);
42
43 const handleFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {
44 e.preventDefault();
45 const validImages = images.filter((img): img is string => typeof img === "string");
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3import { BranchControl } from "./BranchControl.tsx";
4
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React, { useEffect, useState } from "https://esm.sh/react@18.2.0?dev";
3import { CreateBranch } from "./CreateBranch.tsx";
4
84
85 // Handle branch selection change
86 const handleBranchChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
87 const newBranchId = e.target.value;
88 setBranchId(newBranchId);
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
3import React, { useState } from "https://esm.sh/react@18.2.0?dev";
4import { Chat } from "./Chat.tsx";
5import { Login } from "./Login.tsx";
1/** @jsxImportSource https://esm.sh/react@18.2.0?dev */
2import React from "https://esm.sh/react@18.2.0?dev";
3
4interface ApiKeyWarningProps {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useEffect, useState } from "https://esm.sh/react@18.2.0";
3
4export function Section({ children }: any) {
1# React Hono Starter
2
3This app is a starter template for client-side React and server-side Hono.
4
5- **Remix** this starter template on the top right to get started.
7- The **entrypoint** is `/backend/index.ts`. That's the backend HTTP server, which also serves the all the frontend assets.
8
9- The **client-side entrypoint** is `/frontend/index.html`, which in turn imports `/frontend/index.tsx`, which in turn imports the React app from `/frontend/App.tsx`.
10
11[React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a fuller featured example project, with a SQLite database table, queries, client-side CSS and a favicon, and some shared code that runs on both client and server.
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { App } from "./App.tsx";
4