mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-24 15:42:26 +03:00
d0b8b797f6
Co-authored-by: Zewed <dewez.antoine2@gmail.com> Co-authored-by: Antoine Dewez <44063631+Zewed@users.noreply.github.com>
14 lines
376 B
TypeScript
14 lines
376 B
TypeScript
import { useContext } from "react";
|
|
|
|
import { MenuContext } from "../Menu-provider";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const useMenuContext = () => {
|
|
const context = useContext(MenuContext);
|
|
if (context === undefined) {
|
|
throw new Error("useMenuContext must be used within a MenuProvider");
|
|
}
|
|
|
|
return context;
|
|
};
|