feat: getList action

This commit is contained in:
karishmas6
2024-08-08 00:17:47 +05:30
parent b9ff4b5fac
commit 1cea5a7ac6

View File

@@ -2,6 +2,7 @@ import React, { createContext, useContext, useState, ReactNode } from 'react';
interface ActionContextProps {
getText: boolean;
getList: boolean;
getScreenshot: boolean;
startGetText: () => void;
stopGetText: () => void;
@@ -13,6 +14,7 @@ const ActionContext = createContext<ActionContextProps | undefined>(undefined);
export const ActionProvider = ({ children }: { children: ReactNode }) => {
const [getText, setGetText] = useState<boolean>(false);
const [getList, setGetList] = useState<boolean>(false);
const [getScreenshot, setGetScreenshot] = useState<boolean>(false);
const startGetText = () => setGetText(true);
@@ -22,7 +24,7 @@ export const ActionProvider = ({ children }: { children: ReactNode }) => {
const stopGetScreenshot = () => setGetScreenshot(false);
return (
<ActionContext.Provider value={{ getText, getScreenshot, startGetText, stopGetText, startGetScreenshot, stopGetScreenshot }}>
<ActionContext.Provider value={{ getText, getList, getScreenshot, startGetText, stopGetText, startGetScreenshot, stopGetScreenshot }}>
{children}
</ActionContext.Provider>
);