healthdatasimplemain.tsx4 matches
1/** @jsxImportSource https://esm.sh/react */
2import React from "https://esm.sh/react";
3import { renderToString } from "https://esm.sh/react-dom/server";
4import { createRoot } from "https://esm.sh/react-dom/client";
56const BLOB_KEY = 'health_data';
starlightFakermain.tsx5 matches
1/** @jsxImportSource https://esm.sh/react */
2import React, { useState, useEffect } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
4import ReactMarkdown from "https://esm.sh/react-markdown";
5import remarkGfm from "https://esm.sh/remark-gfm";
6import { faker } from "https://esm.sh/@faker-js/faker";
170</div>
171<div className="preview">
172<ReactMarkdown remarkPlugins={[remarkGfm]}>{markdown}</ReactMarkdown>
173</div>
174</div>
1/** @jsxImportSource https://esm.sh/react */
2import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
3import { html } from "https://esm.town/v/stevekrouse/html";
4import { SparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVGReact";
5import { renderToString } from "npm:react-dom/server";
67function StatusRow({ rows }) {
successiveVioletGrousemain.tsx4 matches
1/**
2* This game challenges players to click and hold a button for as long as possible.
3* It uses React for the UI, SQLite for storing high scores, and includes a leaderboard.
4* The game features vibrant colors and a pre-game explanation.
5*/
6/** @jsxImportSource https://esm.sh/react */
7import React, { useState, useEffect, useRef } from "https://esm.sh/react";
8import { createRoot } from "https://esm.sh/react-dom/client";
910function App() {
1/** @jsxImportSource https://esm.sh/react */
23import valleGetValsContextWindow from "https://esm.town/v/janpaul123/valleGetValsContextWindow";
14import { Hono } from "npm:hono@3";
15import _ from "npm:lodash@4";
16import { renderToString } from "npm:react-dom/server";
1718function parseSearchReplaceBlocks(content: string): Array<{ searchStart: string; searchEnd: string; replace: string }> {
232executed on every HTTP request.
233The val should return a valid HTML website, don't make JUST a backend unless explicitly asked for.
234You can use React but you don't have to.
235`.replace("\n", " ");
236246const changesMessages = function({ currentCode, userprompt }: { currentCode: string; userprompt: string }) {
247if (!currentCode) {
248currentCode = `/** @jsxImportSource https://esm.sh/react */
249250import React from "npm:react";
251import { renderToString } from "npm:react-dom/server";
252253const Example = () => (<html></html>);
293executed on every HTTP request.
294The val should return a valid HTML website, don't make JUST a backend unless explicitly asked for.
295You can use React but you don't have to.
296Take requests for changes to the supplied code.
297If the request is ambiguous, ask questions.
407code as possible, only changing things that are strictly necessary to change.
408\`\`\`ts
409/** @jsxImportSource https://esm.sh/react */
410411import React from "npm:react";
412import { renderToString } from "npm:react-dom/server";
413414const Example = () => (<html></html>);
431\`\`\`ts
432[SEARCH_START_SINGLE_LINE]
433import React from "npm:react";
434[/SEARCH_START_SINGLE_LINE]
435[SEARCH_END_SINGLE_LINE]
436[/SEARCH_END_SINGLE_LINE]
437[REPLACE]
438// This val creates a simple "Hello World" page using React.
439// We'll use React and ReactDOMServer for server-side rendering.
440// The approach is straightforward: create a React component and render it to HTML.
441442import React from "npm:react";
443[/REPLACE]
444\`\`\`
479code as possible, only changing things that are strictly necessary to change.
480\`\`\`ts
481/** @jsxImportSource https://esm.sh/react */
482483// This val creates a simple "Hello World" page using React.
484// We'll use React and ReactDOMServer for server-side rendering.
485// The approach is straightforward: create a React component and render it to HTML.
486487import React from "npm:react";
488import { renderToString } from "npm:react-dom/server";
489490const HelloWorld = () => (
516\`\`\`ts
517[SEARCH_START_SINGLE_LINE]
518// The approach is straightforward: create a React component and render it to HTML.
519[/SEARCH_START_SINGLE_LINE]
520[SEARCH_END_SINGLE_LINE]
521[/SEARCH_END_SINGLE_LINE]
522[REPLACE]
523// The approach is straightforward: create a React component and render it to HTML.
524// We import Tailwind CSS and apply classes to our React elements to style the page.
525[/REPLACE]
526\`\`\`
560code as possible, only changing things that are strictly necessary to change.
561\`\`\`ts
562/** @jsxImportSource https://esm.sh/react */
563564// This val creates a simple Hacker News clone using React, Tailwind CSS, and blob storage.
565// We'll use React and ReactDOMServer for server-side rendering, Tailwind for styling,
566// and blob storage to persist and retrieve posts.
567568import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
569import { blob } from "https://esm.town/v/std/blob";
570import React from "npm:react";
571import { renderToString } from "npm:react-dom/server";
572573const { name } = extractValInfo(import.meta.url);
611const initialPosts: Post[] = [
612{ id: 1, title: "Deno 1.0 Released", url: "https://deno.land/", score: 100 },
613{ id: 2, title: "React 18 Announced", url: "https://reactjs.org/", score: 80 },
614{ id: 3, title: "Tailwind CSS v3.0", url: "https://tailwindcss.com/", score: 60 },
615];
764role: "user",
765content:
766`For all requests below, use React and Tailwind for the frontend, and blob storage for the backend, unless otherwise specified.`,
767},
768{
rainyAquamarineDonkeymain.tsx3 matches
1/** @jsxImportSource https://esm.sh/react */
2import React from "https://esm.sh/react";
3import styled, { keyframes } from "https://esm.sh/styled-components";
450const root = document.getElementById("root");
51if (root) {
52import("https://esm.sh/react-dom/client").then(({ createRoot }) => {
53createRoot(root).render(<App />);
54});
personalDatamain.tsx1 match
80{
81"name": "Web Development",
82"keywords": ["HTML5", "CSS", "Tailwind CSS", "React", "Next.js", "Vite", "FastAPI", "Hono", "Framer Motion"]
83},
84{
redBallComponentmain.tsx5 matches
1/** @jsxImportSource https://esm.sh/react */
2import React from "https://esm.sh/react";
34const pulseKeyframes = `
28<meta name="viewport" content="width=device-width, initial-scale=1.0">
29<title>Red Ball Component</title>
30<script src="https://unpkg.com/react@17/umd/react.development.js"></script>
31<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
32<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
33<style>
63}
64
65ReactDOM.render(<RedBall />, document.getElementById('root'));
66</script>
67</body>
faviconGeneratormain.tsx4 matches
2// The favicon will be displayed on the page for the user to download.
34/** @jsxImportSource https://esm.sh/react */
5import React, { useState } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
78function App() {
12const [loading, setLoading] = useState(false);
1314const handleSubmit = async (e: React.FormEvent) => {
15e.preventDefault();
16setLoading(true);
dbpediaenhancedmain.tsx35 matches
1import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
2import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
34function sanitizeHtml(html) {
85};
8687return React.createElement(
88"div",
89{ className: "container mx-auto px-4 py-8" },
90React.createElement("h1", { className: "text-3xl font-bold text-center mb-8" }, "DBpedia Entity Search"),
91React.createElement(
92"form",
93{ onSubmit: handleSubmit, className: "flex mb-8" },
94React.createElement("input", {
95type: "text",
96value: query,
99className: "flex-grow p-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500",
100}),
101React.createElement(
102"button",
103{
108)
109),
110loading && React.createElement("p", { className: "text-center" }, "Loading..."),
111error && React.createElement("p", { className: "text-red-500 text-center" }, error),
112results.length > 0 && React.createElement(
113"div",
114{ className: "bg-white shadow-md rounded-md p-6" },
115React.createElement("h2", { className: "text-2xl font-semibold mb-4" }, "Search Results:"),
116React.createElement(
117"div",
118{ className: "grid gap-6" },
119results.map((result, index) =>
120React.createElement(
121"div",
122{ key: index, className: "border-b border-gray-200 pb-4 last:border-b-0 flex" },
123result.image && React.createElement(
124"div",
125{ className: "mr-4 flex-shrink-0" },
126React.createElement("img", {
127src: result.image,
128alt: result.label || "Entity image",
130})
131),
132React.createElement(
133"div",
134{ className: "flex-grow" },
135React.createElement(
136"h3",
137{ className: "text-xl font-semibold mb-2" },
138React.createElement(
139"a",
140{
146sanitizeHtml(result.label && result.label[0])
147),
148React.createElement(
149"span",
150{ className: "ml-2 text-sm font-normal text-gray-500" },
152)
153),
154result.comment && result.comment[0] && React.createElement("p", { className: "text-gray-600 mb-2" }, sanitizeHtml(result.comment[0])),
155result.type && React.createElement(
156"p",
157{ className: "text-sm text-gray-500" },
159result.type.map(type => type.split("/").pop()).join(", ")
160),
161result.category && React.createElement(
162"p",
163{ className: "text-sm text-gray-500" },
165result.category.map(cat => cat.split("/").pop()).join(", ")
166),
167React.createElement(
168"div",
169{ className: "mt-2 text-sm text-gray-500" },
170React.createElement("p", { className: "font-semibold" }, "Score Calculation:"),
171React.createElement(
172"ul",
173{ className: "list-disc list-inside" },
174result.explanation.map((exp, i) => React.createElement("li", { key: i }, exp))
175)
176)
180)
181),
182results.length === 0 && !loading && !error && React.createElement("p", { className: "text-center" }, "No results found."),
183React.createElement(
184"footer",
185{ className: "mt-8 text-center text-sm text-gray-600" },
186React.createElement(
187"a",
188{
195)
196),
197React.createElement(
198"div",
199{ className: "mt-8 bg-gray-100 p-4 rounded-md" },
200React.createElement("h3", { className: "text-lg font-semibold mb-2" }, "API Endpoints:"),
201React.createElement(
202"pre",
203{ className: "bg-gray-200 p-2 rounded text-sm overflow-x-auto" },
205Raw JSON: GET /api/raw?query=your_query`
206),
207React.createElement("h3", { className: "text-lg font-semibold mt-4 mb-2" }, "cURL Example:"),
208React.createElement(
209"pre",
210{ className: "bg-gray-200 p-2 rounded text-sm overflow-x-auto" },
216217function client() {
218createRoot(document.getElementById("root")).render(React.createElement(App));
219}
220