mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-12 19:39:27 +03:00
9bb7ccf651
* feat: add providers mocks * test(<ChatPage/>: add render test using providers
15 lines
376 B
TypeScript
15 lines
376 B
TypeScript
import { useContext } from "react";
|
|
|
|
import { SupabaseContext } from "../supabase-provider";
|
|
import { SupabaseContextType } from "../types";
|
|
|
|
export const useSupabase = (): SupabaseContextType => {
|
|
const context = useContext(SupabaseContext);
|
|
|
|
if (context === undefined) {
|
|
throw new Error("useSupabase must be used inside SupabaseProvider");
|
|
}
|
|
|
|
return context;
|
|
};
|