feat: start/stop bw actions

This commit is contained in:
karishmas6
2024-07-24 21:37:26 +05:30
parent ea2ead1749
commit 1ce7e88417

View File

@@ -21,7 +21,7 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => {
const [isSettingsDisplayed, setIsSettingsDisplayed] = React.useState<boolean>(false);
const { lastAction } = useGlobalInfoStore();
const { handleGetText, handleGetScreenshot } = useActionContext();
const { getText, getScreenshot, startGetText, stopGetText, startGetScreenshot, stopGetScreenshot } = useActionContext();
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
setContent(newValue);
@@ -39,6 +39,7 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => {
}
}, [pairForEdit])
return (
<Paper
variant="outlined"
@@ -82,12 +83,18 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => {
: null
}
<Button variant="contained" onClick={handleGetText}>
Capture Text
</Button>
<Button variant="contained" onClick={handleGetScreenshot}>
Capture Screenshot
</Button>
<Button variant="contained" onClick={startGetText} disabled={getText}>
Capture Text
</Button>
<Button variant="contained" onClick={stopGetText} disabled={!getText}>
Stop Capture Text
</Button>
<Button variant="contained" onClick={startGetScreenshot} disabled={getScreenshot}>
Capture Screenshot
</Button>
<Button variant="contained" onClick={stopGetScreenshot} disabled={!getScreenshot}>
Stop Capture Screenshot
</Button>
</Paper>
);
};