quivr/frontend/lib/context/BrainProvider/brain-provider.tsx
Mamadou DICKO 9bb7ccf651
Frontend/test/chat 1 (#508)
* feat: add providers mocks

* test(<ChatPage/>: add render test using providers
2023-07-05 09:30:22 +02:00

23 lines
482 B
TypeScript

"use client";
import { createContext } from "react";
import { useBrainState } from "./hooks/useBrainState";
import { BrainContextType } from "./types";
export const BrainContext = createContext<BrainContextType | undefined>(
undefined
);
export const BrainProvider = ({
children,
}: {
children: React.ReactNode;
}): JSX.Element => {
const brainState = useBrainState();
return (
<BrainContext.Provider value={brainState}>{children}</BrainContext.Provider>
);
};