quivr/frontend/lib/context/BrainProvider/brain-provider.tsx
Mamadou DICKO 3ba2c92b50
Frontent/test/explore/1 (#552)
* refactor(MultipleBrain): separate providing and data fetching

* refactor(MultipleBrain): update useBrainApi

* feat(MultipleBrains): remove unnecessary data fetchings

* test(useBrainApi): update unit tests
2023-07-07 12:56:08 +02:00

25 lines
519 B
TypeScript

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