diff --git a/src/context/browserActions.tsx b/src/context/browserActions.tsx index 46d2d936..7afc5337 100644 --- a/src/context/browserActions.tsx +++ b/src/context/browserActions.tsx @@ -8,3 +8,13 @@ interface ActionContextType { resetActions: () => void; } +const ActionContext = createContext(undefined); + +export const useActionContext = (): ActionContextType => { + const context = useContext(ActionContext); + if (context === undefined) { + throw new Error('useActionContext must be used within an ActionProvider'); + } + return context; +}; +