mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-18 08:02:03 +03:00
072d97adb1
* feat: add prompt trigger to mention input * feat: update chat shortcuts * test: update BrainProviderMock * feat: improve ux * feat: update message header position * feat: improve mention input dx * fix(MentionInput): fix minor bugs * feat: refactor <ShareBrain/> * feat: add brain sharing button * fix: make popover buttons click working * feat: update backspace handle logic * feat: update add new brain button ui
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { createContext, PropsWithChildren } from "react";
|
|
|
|
import { BrainContextType } from "../types";
|
|
|
|
export const BrainContextMock = createContext<BrainContextType | undefined>(
|
|
undefined
|
|
);
|
|
|
|
export const BrainProviderMock = ({
|
|
children,
|
|
}: PropsWithChildren): JSX.Element => {
|
|
return (
|
|
<BrainContextMock.Provider
|
|
value={{
|
|
allBrains: [],
|
|
publicPrompts:[],
|
|
currentBrain: undefined,
|
|
//@ts-ignore we are not using the functions in tests
|
|
createBrain: () => void 0,
|
|
//@ts-ignore we are not using the functions in tests
|
|
deleteBrain: () => void 0,
|
|
//@ts-ignore we are not using the functions in tests
|
|
currentBrainId: undefined,
|
|
//@ts-ignore we are not using the functions in tests
|
|
fetchAllBrains: () => void 0,
|
|
//@ts-ignore we are not using the functions in tests
|
|
getBrainWithId: () => void 0,
|
|
//@ts-ignore we are not using the functions in tests
|
|
setActiveBrain: () => void 0,
|
|
//@ts-ignore we are not using the functions in tests
|
|
setDefaultBrain: () => void 0,
|
|
}}
|
|
>
|
|
{children}
|
|
</BrainContextMock.Provider>
|
|
);
|
|
};
|