mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-15 21:53:59 +03:00
9bb7ccf651
* feat: add providers mocks * test(<ChatPage/>: add render test using providers
15 lines
379 B
TypeScript
15 lines
379 B
TypeScript
import { useContext } from "react";
|
|
|
|
import { ChatsContext } from "../chats-provider";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useChatsContext = () => {
|
|
const context = useContext(ChatsContext);
|
|
|
|
if (context === undefined) {
|
|
throw new Error("useChatsStore must be used inside ChatsProvider");
|
|
}
|
|
|
|
return context;
|
|
};
|