MCPcopy Create free account
hub / github.com/TanStack/query / ChatMessage

Function ChatMessage

examples/solid/chat/src/index.tsx:26–43  ·  view source on GitHub ↗
(props: { id: string; question: string })

Source from the content-addressed store, hash-verified

24}
25
26function ChatMessage(props: { id: string; question: string }) {
27 const query = useQuery(() => messagesQueries.detail(props.id, props.question))
28
29 return (
30 <Show
31 when={!query.error}
32 fallback={`An error has occurred: ${query.error?.message}`}
33 >
34 <div>
35 <Message message={{ content: props.question, isQuestion: true }} />
36 <Message
37 inProgress={query.isFetching}
38 message={{ content: (query.data ?? []).join(' '), isQuestion: false }}
39 />
40 </div>
41 </Show>
42 )
43}
44
45function Example() {
46 const [questions, setQuestions] = createSignal<

Callers

nothing calls this directly

Calls 1

useQueryFunction · 0.90

Tested by

no test coverage detected