20 status,
21 } = useChat({
22 api: "/api/send-message",
23 });
24
8 <defs>
9 <style>
10 @import url('https://fonts.googleapis.com/css2?family=Pirata+One&display=swap');
11 text {
12 font-family: 'Pirata One', serif;
2 <defs>
3 <style>
4 @import url('https://fonts.googleapis.com/css2?family=Pirata+One&display=swap');
5 text {
6 font-family: 'Pirata One', serif;
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2import { fetchProjectFiles } from "../utils/api.ts";
3
4interface UseProjectFilesProps {
6 project: any;
7 branchId: string | undefined;
8 anthropicApiKey: string;
9 bearerToken: string;
10 selectedFiles: string[];
16 project,
17 branchId,
18 anthropicApiKey,
19 bearerToken,
20 selectedFiles,
35 status,
36 } = useChat({
37 api: "/api/send-message",
38 body: {
39 project,
40 branchId,
41 anthropicApiKey,
42 selectedFiles,
43 images: images
3 { bearerToken, projectId, branchId }: { bearerToken: string; projectId: string; branchId?: string },
4) {
5 const url = new URL("/api/project-files", window.location.origin);
6 url.searchParams.append("projectId", projectId);
7 if (branchId) {
2import React from "https://esm.sh/react@18.2.0?dev";
3
4interface ApiKeyWarningProps {
5 show: boolean;
6}
7
8export function ApiKeyWarning({ show }: ApiKeyWarningProps) {
9 if (!show) return null;
10
11 return (
12 <div className="bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-4 rounded">
13 <p className="font-bold">Anthropic API Key Missing</p>
14 <p>Please log out and add your Anthropic API key to use this app.</p>
15 </div>
16 );
60 // Get a list of all files in the project
61 const fileListResponse = await fetch(
62 "https://api.val.town/v1/projects/1a0cd106-097f-11f0-b084-569c3dd06744/files?recursive=true",
63 { headers: { "Accept": "application/json" } }
64 );
94 <meta http-equiv="Pragma" content="no-cache">
95 <meta http-equiv="Expires" content="0">
96 <link href="https://fonts.googleapis.com/css2?family=Pirata+One&display=swap" rel="stylesheet">
97 <style>
98 body {
206 <meta http-equiv="Pragma" content="no-cache">
207 <meta http-equiv="Expires" content="0">
208 <link href="https://fonts.googleapis.com/css2?family=Pirata+One&display=swap" rel="stylesheet">
209 <style>
210 body {
11import { rss } from "./rss";
12
13import data from "https://blog.jxnblk.com/api/all.json?d4" with { type: "json" };
14
15interface Params {
1// RSS middleware for jxnblk.com
2
3// import data from "https://blog.jxnblk.com/api/all.json" with { type: "json" };
4import type { Middleware } from "https://esm.town/v/jxnblk/ReactStream";
5