1
1
mirror of https://github.com/StanGirard/quivr.git synced 2024-12-18 08:02:03 +03:00
quivr/frontend/lib/context/BrainProvider/brain-provider.tsx
Mamadou DICKO 3ba2c92b50
Frontent/test/explore/1 ()
* 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>
);
};