1import type { Meta, StoryObj } from "@storybook/react";
2import { DashboardCard } from "./DashboardCard";
3
Studybeaststudybeast.tsx4 matches
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";
45// User credentials mapping
201const [error, setError] = useState("");
202203const handleSubmit = (e: React.FormEvent) => {
204e.preventDefault();
205if (USER_CREDENTIALS[username] === password) {
reactHonoStarterREADME.md4 matches
1# React Hono Starter
23This app is a starter template for client-side React and server-side Hono.
45## Getting started
13- The **client-side entrypoint** is [`/frontend/index.html`](/frontend/index.html)
14- which in turn imports [`/frontend/index.tsx`](/frontend/index.tsx)
15- which in turn imports the React app from [`/frontend/components/App.tsx`](/frontend/components/App.tsx).
1617So if you wanted to get a sense of how this app comes together, we suggest reading the files in this order:
21## Further resources
2223- [React Hono Example](https://www.val.town/x/stevekrouse/reactHonoExample) is a bigger example project, with a SQLite database table, queries, client-side CSS, a favicon, and shared code that runs on both client and server.
reactHonoStarterindex.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import { App } from "./components/App.tsx";
4
reactHonoStarterindex.html1 match
4<meta charset="UTF-8">
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>React Hono Val Town Starter</title>
7<link rel="stylesheet" href="/frontend/style.css">
8<link rel="icon" href="/frontend/favicon.svg" type="image/svg+xml">
reactHonoStarterApp.tsx3 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { useState } from "https://esm.sh/react@18.2.0";
34export function App() {
6return (
7<div>
8<h1>Val Town React + Hono Starter</h1>
9I've been clicked <button onClick={() => setClicked((c) => c + 1)}>{clicked}</button> times
10</div>
houseSearchSFscrapedHouses.tsx4 matches
1// This val creates a form to input a Zillow or Craigslist link, determines the link type,
2// calls the appropriate scraping API, and renders the results in a table.
3// It uses React for the UI, fetch for API calls, and basic string manipulation for link validation.
45/** @jsxImportSource https://esm.sh/react */
6import React, { useState } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
89function App() {
finalScrapermain.tsx4 matches
1// This val creates a form to input a Zillow or Craigslist link, determines the link type,
2// calls the appropriate scraping API, and renders the results in a table.
3// It uses React for the UI, fetch for API calls, and basic string manipulation for link validation.
45/** @jsxImportSource https://esm.sh/react */
6import React, { useState } from "https://esm.sh/react";
7import { createRoot } from "https://esm.sh/react-dom/client";
89function App() {
ChatuseAnthropicStream.tsx12 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import Anthropic, { MessageStreamEvent } from "https://esm.sh/@anthropic-ai/sdk";
3import React from "https://esm.sh/react@18.2.0";
45// External shared types
193194export default function useAnthropicStream(config: AppConfig) {
195const [status, setStatus] = React.useState<Status>("idle");
196const [liveBlocks, setLiveBlocks] = React.useState<any[] | null>(null);
197const [pendingTool, setPendingTool] = React.useState<PendingToolExecution | null>(null);
198const abortRef = React.useRef<AbortController | null>(null);
199200/* Anthropic SDK instance – memoised so we don't recreate each render */
201const anthropic = React.useMemo(() => {
202if (!config.anthropicApiKey) return null;
203return new Anthropic({
213214/* Abort helper */
215const abort = React.useCallback(() => {
216abortRef.current?.abort();
217abortRef.current = null;
226227/* Resolve pending tool execution */
228const resolvePendingTool = React.useCallback((response: string) => {
229if (pendingTool) {
230pendingTool.resolve(response);
234235/* Cancel pending tool execution */
236const cancelPendingTool = React.useCallback(() => {
237if (pendingTool) {
238pendingTool.resolve("(No response provided)");
242243/* Stream a single message */
244const streamMessage = React.useCallback(
245async (messages: any[]): Promise<{ message: AssistantMsg; stopReason: string }> => {
246if (!anthropic) throw new Error("API key missing");
336337/* Main send/stream function with tool use loop */
338const send = React.useCallback(
339async (history: Message[], userText: string): Promise<Message[]> => {
340if (!anthropic) throw new Error("API key missing");
ChatMessage.tsx2 matches
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4import type { NextStepsOutput, AskUserToolInput } from "../../shared/types.ts";
5import { MCPClient } from "../utils/MCPClient.ts";