theHereTimesmain.tsx34 matches
1617import { Loader } from "https://esm.sh/@googlemaps/js-api-loader@1.16.2";
18import ReactDOM from "https://esm.sh/react-dom@18.2.0";
19import React from "https://esm.sh/react@18.2.0";
2021function App() {
22const mapRef = React.useRef(null);
23const [map, setMap] = React.useState(null);
24const [center, setCenter] = React.useState({ lat: 40.7128, lng: -74.006 });
25const [zoom, setZoom] = React.useState(10);
26const [news, setNews] = React.useState([]);
27const [locations, setLocations] = React.useState([]);
28const [isDrawerOpen, setIsDrawerOpen] = React.useState(false);
29const [error, setError] = React.useState(null);
30const markersRef = React.useRef([]);
31const [googleMaps, setGoogleMaps] = React.useState(null);
32const [selectedLocation, setSelectedLocation] = React.useState(null);
33const [searchQuery, setSearchQuery] = React.useState("");
34const searchBoxRef = React.useRef(null);
3536React.useEffect(() => {
37const initMap = async () => {
38try {
106}, []);
107108React.useEffect(() => {
109if (map && locations.length > 0 && googleMaps) {
110console.log("Updating markers. Number of locations:", locations.length);
204};
205206const filteredNews = React.useMemo(() => {
207if (!selectedLocation) return [];
208return news.filter(article => article.title.toLowerCase().includes(selectedLocation.name.toLowerCase()));
209}, [news, selectedLocation]);
210211return React.createElement(
212"div",
213{ style: { display: "flex", flexDirection: "column", height: "100vh" } },
214React.createElement(
215"div",
216{ id: "search-container", className: "search-container" },
217React.createElement("input", {
218id: "search-input",
219type: "text",
223}),
224),
225React.createElement("div", { ref: mapRef, style: { flexGrow: 1 } }),
226isDrawerOpen && React.createElement(
227"div",
228{ className: "drawer" },
229React.createElement("button", { onClick: () => setIsDrawerOpen(false), className: "close-button" }, "×"),
230React.createElement("h2", null, selectedLocation ? `News for ${selectedLocation.name}` : "Local News"),
231error
232? React.createElement("p", { className: "error" }, error)
233: filteredNews.length > 0
234? filteredNews.map((article, index) =>
235React.createElement(
236"div",
237{ key: index, className: "article" },
238React.createElement("h3", null, article.title),
239React.createElement("p", null, article.description),
240React.createElement("a", { href: article.url, target: "_blank", rel: "noopener noreferrer" }, "Read more"),
241)
242)
243: React.createElement("p", null, "No news articles found for this location."),
244),
245React.createElement(
246"div",
247{ className: "attribution" },
248React.createElement(
249"a",
250{
260261function client() {
262ReactDOM.createRoot(document.getElementById("root")).render(React.createElement(App));
263}
264
infoboxCrawlermain.tsx3 matches
1/** @jsxImportSource https://esm.sh/react */
2import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
3import dagre from "https://esm.sh/cytoscape-dagre@2.5.0";
4import cytoscape from "https://esm.sh/cytoscape@3.23.0";
5import React, { useEffect, useRef, useState } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
78cytoscape.use(dagre);
infoboxCrawlermain.tsx3 matches
1/** @jsxImportSource https://esm.sh/react */
2import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
3import dagre from "https://esm.sh/cytoscape-dagre@2.5.0";
4import cytoscape from "https://esm.sh/cytoscape@3.23.0";
5import React, { useEffect, useRef, useState } from "https://esm.sh/react";
6import { createRoot } from "https://esm.sh/react-dom/client";
78cytoscape.use(dagre);
todoListUsingBlobmain.tsx3 matches
1/** @jsxImportSource https://esm.sh/react */
2import React, { useEffect, useState } from "https://esm.sh/react";
3import { createRoot } from "https://esm.sh/react-dom/client";
45function App() {
valcontributionchartmain.tsx4 matches
1// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
2// and render it using React. We'll use the fetch API to get the data, process it to create a heatmap-like structure,
3// and then use CSS Grid to render the chart with varying shades of green based on the number of vals created each day.
45/** @jsxImportSource https://esm.sh/react */
6import React, { useState, useEffect } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
89function App() {
linkInBioTemplatemain.tsx2 matches
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {
bulletinBoardmain.tsx3 matches
3// The app uses SQLite for data storage and includes both server-side and client-side components.
45/** @jsxImportSource https://esm.sh/react */
6import React, { useEffect, useState } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
89function App() {
religionClickerGamemain.tsx3 matches
1// This val creates a sarcastic idle clicker game about starting a religion.
23/** @jsxImportSource https://esm.sh/react */
4import React, { useEffect, useState } from "https://esm.sh/react";
5import { createRoot } from "https://esm.sh/react-dom/client";
67function App() {
valcontributionchartmain.tsx4 matches
1// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
2// and render it using React. We'll use the fetch API to get the data, process it to create a heatmap-like structure,
3// and then use CSS Grid to render the chart with varying shades of green based on the number of vals created each day.
45/** @jsxImportSource https://esm.sh/react */
6import React, { useState, useEffect } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
89function App() {
knowledgeExplorermain.tsx3 matches
4* and enables exploration of related topics or deeper dives using arrow keys or buttons.
5*/
6/** @jsxImportSource https://esm.sh/react@18.2.0 */
7import React, { useState, useEffect, useCallback } from "https://esm.sh/react@18.2.0";
8import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
910const SUGGESTIONS = ["Quantum Computing", "Renaissance Art", "Climate Change", "Artificial Intelligence", "Space Exploration"];