feat: action provider

This commit is contained in:
karishmas6
2024-07-24 19:30:42 +05:30
parent 5576aa26b0
commit 450e45736d

View File

@@ -18,3 +18,21 @@ export const useActionContext = (): ActionContextType => {
return context;
};
interface ActionProviderProps {
children: ReactNode;
}
export const ActionProvider: React.FC<ActionProviderProps> = ({ children }) => {
const [getText, setGetText] = useState<boolean>(false);
const [getScreenshot, setGetScreenshot] = useState<boolean>(false);
const handleGetText = () => setGetText(true);
const handleGetScreenshot = () => setGetScreenshot(true);
return (
<ActionContext.Provider value={{ getText, getScreenshot, handleGetText, handleGetScreenshot, resetActions }}>
{children}
</ActionContext.Provider>
);
};