quivr/frontend/lib/context/BrainProvider/brain-provider.tsx

25 lines
519 B
TypeScript
Raw Normal View History

"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>
);
};