This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { api } from "@connectlabs/backend/convex/_generated/api"; | |
| import type { Id } from "@connectlabs/backend/convex/_generated/dataModel"; | |
| import { Resvg } from "@resvg/resvg-js"; | |
| import { createServerFileRoute } from "@tanstack/react-start/server"; | |
| import { ConvexHttpClient } from "convex/browser"; | |
| import satori from "satori"; | |
| import sharp from "sharp"; | |
| type AgentData = { | |
| name: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function createCtx<StateType, ActionType>( | |
| reducer: React.Reducer<StateType, ActionType>, | |
| initialState: StateType, | |
| ) { | |
| const defaultDispatch: React.Dispatch<ActionType> = () => initialState // we never actually use this | |
| const ctx = React.createContext({ | |
| state: initialState, | |
| dispatch: defaultDispatch, // just to mock out the dispatch type and make it not optioanl | |
| }) | |
| function Provider(props: React.PropsWithChildren<{}>) { |