()
| 17 | * @throws Error if used outside of Chat component |
| 18 | */ |
| 19 | export function useChatContext(): UseChatReturn { |
| 20 | const context = useContext(ChatContext) |
| 21 | if (!context) { |
| 22 | throw new Error( |
| 23 | "Chat components must be wrapped in <Chat>. Make sure you're using Chat.Messages, Chat.Input, etc. inside a <Chat> component.", |
| 24 | ) |
| 25 | } |
| 26 | return context |
| 27 | } |
| 28 | |
| 29 | export interface ChatProps { |
| 30 | /** Child components (Chat.Messages, Chat.Input, etc.) */ |
no outgoing calls
no test coverage detected