()
| 243 | const AIContext = createContext<AIContextValue>() |
| 244 | |
| 245 | export function useAIStore(): AIContextValue { |
| 246 | const context = useContext(AIContext) |
| 247 | if (!context) { |
| 248 | throw new Error('useAIStore must be used within an AIProvider') |
| 249 | } |
| 250 | return context |
| 251 | } |
| 252 | |
| 253 | export const AIProvider: ParentComponent = (props) => { |
| 254 | const [state, setState] = createStore<AIStoreState>({ |
no outgoing calls
no test coverage detected