({ id, question }: { id: string; question: string })
| 22 | } |
| 23 | |
| 24 | function ChatMessage({ id, question }: { id: string; question: string }) { |
| 25 | const { |
| 26 | error, |
| 27 | data = [], |
| 28 | isFetching, |
| 29 | } = useQuery(messagesQueries.detail(id, question)) |
| 30 | |
| 31 | if (error) return `An error has occurred: ${error.message}` |
| 32 | |
| 33 | return ( |
| 34 | <div> |
| 35 | <Message message={{ content: question, isQuestion: true }} /> |
| 36 | <Message |
| 37 | inProgress={isFetching} |
| 38 | message={{ content: data.join(' '), isQuestion: false }} |
| 39 | /> |
| 40 | </div> |
| 41 | ) |
| 42 | } |
| 43 | |
| 44 | function Example() { |
| 45 | const [questions, setQuestions] = useState< |
nothing calls this directly
no test coverage detected