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

23 lines
482 B
TypeScript
Raw Normal View History

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