mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 19:32:47 +03:00
9bb7ccf651
* feat: add providers mocks * test(<ChatPage/>: add render test using providers
23 lines
482 B
TypeScript
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>
|
|
);
|
|
};
|