neighborhoodOrderAppmain.tsx3 matches
4import Cookies from "https://esm.sh/js-cookie";
56function App() {
7const [proposals, setProposals] = useState([]);
8const [newProposal, setNewProposal] = useState({ title: '', proposer: '', targetCount: 10 });
250}
251252function client() {
253createRoot(document.getElementById("root")).render(<App />);
254}
255if (typeof document !== "undefined") { client(); }
256257export default async function server(request: Request): Promise<Response> {
258const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
259const SCHEMA_VERSION = 2
simpleWikipediaInstantSearchmain.tsx2 matches
166});
167168async function fetchResults(query) {
169try {
170const response = await fetch(\`/search?q=\${encodeURIComponent(query)}\`);
176}
177178function displayResults(results) {
179searchResults.innerHTML = '';
180if (results.length > 0) {
falDemoAppmain.tsx3 matches
5import { falProxyRequest } from "https://esm.town/v/stevekrouse/falProxyRequest";
67function App() {
8const [prompt, setPrompt] = useState("");
9const [imageUrls, setImageUrls] = useState<string[]>([]);
125}
126127function client() {
128createRoot(document.getElementById("root")).render(<App />);
129}
130if (typeof document !== "undefined") { client(); }
131132export default async function server(req: Request): Promise<Response> {
133const url = new URL(req.url);
134if (url.pathname === "/") {
singlePageUrlCheckermain.tsx4 matches
248}
249250// Main Function
251export async function findBrokenLinks(websiteUrl) {
252try {
253console.log(`Starting findBrokenLinks for website: ${websiteUrl}`);
273274// HTTP request handler
275export default async function(req: Request): Promise<Response> {
276const url = new URL(req.url).searchParams.get("url") || "https://willkrouse.com/projects";
277console.log(`Starting broken link check at ${new Date().toISOString()}`);
299});
300} catch (error) {
301console.error(`Error in main function: ${error.message}`);
302return new Response(JSON.stringify({ error: error.message }), {
303status: 500,
5const { author, name } = extractValInfo(import.meta.url);
67export async function forwarder(e: Email) {
8let attachments: AttachmentData[] = [];
9for (const f of e.attachments) {
valcoinDashboardmain.tsx7 matches
5const API_URL = "https://aggy-valcoinapi.web.val.run";
67function App() {
8const [wallets, setWallets] = useState([]);
9const [sourceKey, setSourceKey] = useState("");
17}, []);
1819async function fetchWallets() {
20try {
21const response = await fetch(`${API_URL}/wallets`);
29}
3031async function createWallet() {
32try {
33const response = await fetch(`${API_URL}/create-wallet`, { method: "POST" });
48}
4950async function transferValCoin() {
51// Input validation
52if (!sourceKey || !destinationHash || !amount) {
98}
99100function FeedbackMessage({ message, type }) {
101const bgColor = type === "success" ? "bg-green-100 border-green-400 text-green-700" : "bg-red-100 border-red-400 text-red-700";
102return (
183}
184185function renderApp() {
186const appHtml = renderToString(<App />);
187return `
207}
208209export default async function(req: Request): Promise<Response> {
210return new Response(renderApp(), {
211headers: { "Content-Type": "text/html" },
countGithubLOCUImain.tsx9 matches
2* This val creates a website to count lines of code in GitHub repositories.
3* It uses a server-side API to fetch the data and a client-side UI for user interaction.
4* It now includes sharing functionality and URL manipulation for better user experience.
5*/
6import countGithubLOC from 'https://esm.town/v/g/countGithubLOC';
10import { getEndpointUrl } from "https://esm.town/v/g/getEndpointUrl";
1112function html() {
13/*
14<!DOCTYPE html>
62}
6364function css() {
65/*
66body {
156}
157158function js() {
159/*
160const form = document.getElementById('repoForm');
167const shareButton = document.getElementById('shareButton');
168169function parseQueryParams() {
170const urlParams = new URLSearchParams(window.location.search);
171const user = urlParams.get('user');
179}
180181async function countLines(user, repo) {
182resultDiv.classList.add('hidden');
183errorDiv.classList.add('hidden');
219});
220221function parseGitHubUrl(url) {
222try {
223const parsedUrl = new URL(url);
232}
233234function handlePaste(e) {
235const pastedText = (e.clipboardData || window.clipboardData).getData('text');
236const parsedRepo = parseGitHubUrl(pastedText);
252}
253254function shareTemplate(user: string, repo: string) {
255const endpoint = getEndpointUrl(import.meta.url);
256const url = new URL(`/gh/${encodeURIComponent(user)}/${encodeURIComponent(repo)}`, endpoint);
countGithubLOCmain.tsx2 matches
1import { Unzip, UnzipInflate, strFromU8 } from 'https://esm.sh/fflate';
23export default function countGithubLOC(username: string, repoName: string) {
4return new Promise((resolve, reject) => {
5const repo = `${username}/${repoName}`;
2526const reader = res.body.getReader();
27function onread({ done, value }: ReadableStreamReadResult<Uint8Array>) {
28unzip.push(done ? new Uint8Array(0) : value, done);
29if(!done) reader.read().then(onread).catch(reject);
multilingualchatroommain.tsx9 matches
93};
9495function Banner({ message, isVisible, language }) {
96if (!isVisible) return null;
97return <div className="banner">{message[language] || message.en}</div>;
98}
99100function UserList({ users, t }) {
101return (
102<div className="user-list">
113}
114115function Sidebar({ users, language, handleLanguageChange, roomUrl, copyToClipboard, copied, t }) {
116return (
117<div className="sidebar">
149}
150151function TypingIndicator({ typingUsers, t }) {
152if (typingUsers.length === 0) return null;
153
164}
165166function App() {
167const [messages, setMessages] = useState([]);
168const [inputMessage, setInputMessage] = useState("");
490}
491492function client() {
493createRoot(document.getElementById("root")).render(<App />);
494}
495if (typeof document !== "undefined") { client(); }
496497export default async function server(request: Request): Promise<Response> {
498const url = new URL(request.url);
499const { blob } = await import("https://esm.town/v/std/blob");
508const TIME_WINDOW = 60 * 1000; // 1 minute
509510async function checkRateLimit() {
511const now = Date.now();
512const rateLimit = await blob.getJSON(RATE_LIMIT_KEY) || { count: 0, timestamp: now };
523}
524525async function translateText(text: string, targetLanguage: string, sourceLanguage: string): Promise<string> {
526const cacheKey = `${KEY}_translation_${sourceLanguage}_${targetLanguage}_${text}`;
527const cachedTranslation = await blob.getJSON(cacheKey);
solanaPayDemomain.tsx3 matches
19import { createRoot } from "https://esm.sh/react-dom/client";
2021function Home() {
22const [storeName, setStoreName] = useState("");
23const [description, setDescription] = useState("");
238}
239240function client() {
241createRoot(document.getElementById("root")).render(<Home />);
242}
243if (typeof document !== "undefined") { client(); }
244245export default async function server(request: Request): Promise<Response> {
246return new Response(
247`