5import { renderToString } from "npm:react-dom/server";
6
7function StatusRow({ rows }) {
8 return (
9 <div className="w-full flex flex-col space-y-2">
28}
29
30function StatusSection({ url, rows }) {
31 const sectionRows = rows.filter(row => row[0] === url);
32 const percentUp = Math.round((sectionRows.filter(row => row[1]).length / sectionRows.length) * 100);
44}
45
46export default async function(req: Request): Promise<Response> {
47 const { rows } = await sqlite.execute(
48 "select url, ok, duration, timestamp from uptime order by timestamp desc limit 200",
6);
7
8export async function uptimeCheck(url: string) {
9 let ok = true;
10 let reason: string;
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [germanText, setGermanText] = useState("");
7 const [englishTranslation, setEnglishTranslation] = useState("");
61}
62
63function client() {
64 createRoot(document.getElementById("root")).render(<App />);
65}
69}
70
71export default async function server(request: Request): Promise<Response> {
72 return new Response(
73 `
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function Popup({ isOpen, onClose, content }) {
6 const [convertedImages, setConvertedImages] = useState({});
7 const [converting, setConverting] = useState({});
92}
93
94function HTMLPreview({ html, isFullView, toggleView }) {
95 return (
96 <div className="html-preview-container">
111}
112
113function App() {
114 const [url, setUrl] = useState('');
115 const [results, setResults] = useState(null);
305}
306
307function client() {
308 createRoot(document.getElementById("root")).render(<App />);
309}
313}
314
315export default async function server(request: Request): Promise<Response> {
316 const url = new URL(request.url);
317
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [imageUrl, setImageUrl] = useState(null);
7 const [webpUrl, setWebpUrl] = useState(null);
93}
94
95function client() {
96 createRoot(document.getElementById("root")).render(<App />);
97}
99if (typeof document !== "undefined") { client(); }
100
101export default async function server(request: Request): Promise<Response> {
102 return new Response(`
103 <!DOCTYPE html>
4import { createRoot } from "https://esm.sh/react-dom/client";
5
6function App() {
7 const [colors, setColors] = useState(['#ff0000', '#00ff00', '#0000ff']);
8 const [positions, setPositions] = useState([
89}
90
91function client() {
92 createRoot(document.getElementById("root")).render(<App />);
93}
94if (typeof document !== "undefined") { client(); }
95
96export default async function server(request: Request): Promise<Response> {
97 return new Response(`
98 <html>
5const { author, name } = extractValInfo(import.meta.url);
6
7export async function forwarder(e: Email) {
8 let attachments: AttachmentData[] = [];
9 for (const f of e.attachments) {
2import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
3
4export async function aqi(interval: Interval) {
5 const location = "80212"; // <-- change to place, city, or zip code
6 const data = await easyAQI({ location });
31};
32
33function App() {
34 const [hoveredRegion, setHoveredRegion] = useState("");
35 const [selectedRegions, setSelectedRegions] = useState([]);
296}
297
298function client() {
299 createRoot(document.getElementById("root")).render(<App />);
300}
304}
305
306export default async function server(request: Request): Promise<Response> {
307 return new Response(
308 `
23];
24
25function DraggableElement({ id, content, type, left, top, onDrop, isNew }) {
26 const [{ isDragging }, drag] = useDrag(() => ({
27 type: "element",
60}
61
62function cssStringToObject(cssString) {
63 return cssString.split(";").reduce((acc, rule) => {
64 const [key, value] = rule.split(":").map(str => str.trim());
159});
160
161function App() {
162 const [elements, setElements] = useState([]);
163 const [selectedModel, setSelectedModel] = useState(MODELS[0]);
274}
275
276function client() {
277 createRoot(document.getElementById("root")).render(<App />);
278}
282}
283
284async function server(request: Request): Promise<Response> {
285 const url = new URL(request.url);
286 const key = "infiniteUICombinations_3";