1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { type Context, Hono } from "https://esm.sh/hono";
3import { debounce } from "https://esm.sh/lodash-es";
4import React, { ReactNode, useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
5import { parseProject } from "https://esm.town/v/std/parseImportMeta/project";
6import { lastlogin } from "https://esm.town/v/stevekrouse/lastlogin_safe";
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { useDropzone } from "https://esm.sh/react-dropzone?deps=react@18.2.0,react-dom@18.2.0";
4import React, { ReactNode, useCallback, useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
5import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton";
6
7interface TooltipProps {
8 children: ReactNode;
9 content: string;
10}
1/** @jsxImportSource https://esm.sh/react */
2import { preferedProducts } from "https://esm.town/v/jester/GrosProductsUtils";
3import { productsDBName, searchItems } from "https://esm.town/v/jester/Products";
30* If email, show that user's content, and a logout link to "/auth/logout"; if no email, show login options.
31* `import { LoginWithGoogleButton } from "https://esm.town/v/stevekrouse/LoginWithGoogleButton"`
32* Use the <LoginWithGoogleButton /> React Component, optionally supplying the `text` attribute
33* Add "via LastLogin" underneat LoginWithGoogleButton, centered, secondary text, linking to https://lastlogin.io/
34* Pass the email from the server to the client-side code if using React hydration or similar techniques.
35
36### How it works
37
381. Your users click on the <LoginWithGoogleButton /> React Component in your app
392. The <LoginWithGoogleButton /> opens a new window to /auth/login?provider=google in your app
403. This middleware directs them to log into Google via LastLogin
64* If email, show that user's content, and a logout link to "/auth/logout";
65* If no email, add a link to "Login or Sign Up" to "/auth/login"
66* Pass the email from the server to the client-side code if using React hydration or similar techniques.
67
68### How it works
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";
3import { Prism as SyntaxHighlighter } from "https://esm.sh/react-syntax-highlighter?deps=react@18.2.0,react-dom@18.2.0";
4import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
5import STARTER_PROMPTS from "./starter-prompts.js";
6
30}: {
31 prompt: string;
32 setPrompt: React.Dispatch<React.SetStateAction<string>>;
33 handleSubmit: (e: React.FormEvent) => void;
34 handleStarterPromptClick: (promptItem: PromptItem) => void;
35}) {
116
117function App() {
118 const previewRef = React.useRef<HTMLDivElement>(null);
119 const [prompt, setPrompt] = useState("");
120 const [projectId, setProjectId] = useState<number | null>(null);
174 }
175
176 async function handleSubmit(e: React.FormEvent | string) {
177 if (typeof e !== "string") {
178 e.preventDefault();
673 </div>
674 <div className="bg-white w-full h-full flex flex-col grow rounded-xl border-2 border-white overflow-hidden">
675 <React.Fragment key={iframeKey}>
676 <iframe
677 srcDoc={code}
679 className="w-full grow"
680 />
681 </React.Fragment>
682 </div>
683 </div>
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useCallback, useRef } from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4
5function App() {
17 const fileInputRef = useRef<HTMLInputElement>(null);
18
19 const handleFileUpload = useCallback((event: React.DragEvent<HTMLDivElement> | React.ChangeEvent<HTMLInputElement>) => {
20 event.preventDefault();
21 const files = 'dataTransfer' in event
34 }, []);
35
36 const handleDragOver = (event: React.DragEvent<HTMLDivElement>) => {
37 event.preventDefault();
38 };
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
4
5function Logo() {
49 const [showWelcome, setShowWelcome] = useState(true);
50
51 const handleSubmit = async (e: React.FormEvent) => {
52 e.preventDefault();
53 if (!inputValue.trim()) return;
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { 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 {
6 BrowserRouter as Router,
8 Route,
9 Link
10} from "https://esm.sh/react-router-dom@6.22.3?deps=react@18.2.0,react-dom@18.2.0";
11
12// Material UI imports with version pinning
14 ThemeProvider,
15 createTheme
16} from "https://esm.sh/@mui/material@5.15.14/styles?deps=react@18.2.0";
17import {
18 Container,
25 CardMedia,
26 SvgIcon
27} from "https://esm.sh/@mui/material@5.15.14?deps=react@18.2.0";
28
29const theme = createTheme({
1/** @jsxImportSource https://esm.sh/react@18.2.0 **/
2import { renderToString } from "https://esm.sh/react-dom@18.2.0/server";
3
4export default (req: Request) => {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { WebhookForm } from "./WebhookForm.tsx";
4
5export function App({ thisProjectURL }: { thisProjectURL?: string }) {
6 const [webhooks, setWebhooks] = React.useState([]);
7 const [loading, setLoading] = React.useState(true);
8 const [notification, setNotification] = React.useState({ show: false, message: "", type: "" });
9
10 const fetchWebhooks = async () => {
42 };
43
44 React.useEffect(() => {
45 fetchWebhooks();
46 }, []);