1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { Hono } from "https://esm.sh/hono";
3import { html } from "https://esm.sh/hono/helper";
4import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
5import React, { useState } from "https://esm.sh/react@18.2.0";
6
7function App() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function App() {
1/** @jsxImportSource https://esm.sh/react */
2import React, { useEffect, useRef, useState } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0,react-dom@18.2.0";
3import React, { useCallback, useState } from "https://esm.sh/react@18.2.0";
4import { OpenAI } from "https://esm.town/v/std/openai";
5
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect, useRef } from "https://esm.sh/react@18.2.0";
3import ReactDOM from "https://esm.sh/react-dom@18.2.0";
4import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
5import SyntaxHighlighter from "https://esm.sh/react-syntax-highlighter@15.5.0";
6import { materialDark } from "https://esm.sh/react-syntax-highlighter@15.5.0/dist/esm/styles/prism";
7
8// Error Boundary Component
9class ErrorBoundary extends React.Component {
10 constructor(props) {
11 super(props);
18
19 componentDidCatch(error, errorInfo) {
20 console.error("React Error:", error, errorInfo);
21 }
22
174 const root = createRoot(rootElement);
175 root.render(
176 <React.StrictMode>
177 <App />
178 </React.StrictMode>
179 );
180 } else {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import Cerebras from "https://esm.sh/@cerebras/cerebras_cloud_sdk";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client?deps=react@18.2.0";
4import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter?deps=react@18.2.0,react-dom@18.2.0";
5import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
6import { STARTER_PROMPTS } from "https://esm.town/v/stevekrouse/cerebras_coder_prompts";
7
80}: {
81 prompt: string;
82 setPrompt: React.Dispatch<React.SetStateAction<string>>;
83 handleSubmit: (e: React.FormEvent) => void;
84 handleStarterPromptClick: (promptItem: PromptItem) => void;
85}) {
169
170function App() {
171 const previewRef = React.useRef<HTMLDivElement>(null);
172 const [prompt, setPrompt] = useState("");
173 const [projectId, setProjectId] = useState<number | null>(null);
227 }
228
229 async function handleSubmit(e: React.FormEvent | string) {
230 if (typeof e !== "string") {
231 e.preventDefault();
733 </div>
734 <div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
735 <React.Fragment key={iframeKey}>
736 <iframe
737 srcDoc={code}
739 className="w-full grow"
740 />
741 </React.Fragment>
742 </div>
743 </div>
1/** @jsxImportSource https://esm.sh/react */
2import React, { useState } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5const DEFAULT_SEARCHES = [
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useState } from "https://esm.sh/react@18.2.0";
4
5function App() {