(props: { id: string; question: string })
| 24 | } |
| 25 | |
| 26 | function 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 | |
| 45 | function Example() { |
| 46 | const [questions, setQuestions] = createSignal< |
nothing calls this directly
no test coverage detected