4const FILES_ENDPOINT = "/api/project-files";
5
6export function useProject (projectId: string, branchId?: string) {
7 const [data, setData] = useState<any>(null);
8 const [loading, setLoading] = useState(true);
7const NEW_BRANCH_VAL = "__NEW_BRANCH__";
8
9export function BranchSelect () {
10 const { projectId, branchId } = useParams() as {
11 projectId: string;
3const ENDPOINT = "/api/projects-loader";
4
5export function useProjects () {
6 const [data, setData] = useState<any>(null);
7 const [loading, setLoading] = useState(true);
6import { AppContext } from "./App.tsx";
7
8export function Header () {
9 const navigate = useNavigate();
10
25}
26
27function LogOut () {
28 const { user } = useContext(AppContext);
29 return (
46}
47
48function ValTownLogo () {
49 return (
50 <svg
64}
65
66function DarkButton () {
67 const [dark, setDark] = useLocalStorage("DARK_MODE", false);
68 const toggle = () => {
89}
90
91function AudioButton () {
92 const {audio, setAudio} = useContext(AppContext);
93
2import React from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3
4export function EventDetails() {
5 return (
6 <div className="mt-4 p-4 bg-blue-50 rounded-lg border border-blue-100 text-gray-700 text-left w-full">
2import React from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
3
4export function ThankYouMessage() {
5 return (
6 <div className="text-center py-8">
6import { ThankYouMessage } from "./ThankYouMessage.tsx";
7
8export function App() {
9 const [formSubmitted, setFormSubmitted] = useState(false);
10 const [error, setError] = useState<string | null>(null);
1import { useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3export function useUsageStats (messages: any[], usages: any[]) {
4 useEffect(() => {
5 if (!messages?.length) return;
7 *
8 * @param {Array} dependencies - Array of dependencies that trigger scrolling when changed
9 * @returns {Object} An object containing containerRef and scrollToBottom function
10 */
11export function useScrollToBottomContainer(dependencies = []) {
12 const containerRef = useRef(null);
13
28
29// body scroll version
30export function useScrollToBottom(dependencies = []) {
31 const bottomRef = useRef(null);
32
6 * This includes a fallback to inference calls data when usage data is missing
7 */
8export async function getUserSummary() {
9 // First, get the standard grouped data from the usage table
10 const groupedUsageData = await sqlite.execute(`
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.