feat: display in ui
This commit is contained in:
@@ -51,13 +51,15 @@ export const InterpretationButtons = ({ enableStepping }: InterpretationButtonsP
|
|||||||
const decisionHandler = useCallback(
|
const decisionHandler = useCallback(
|
||||||
({ pair, actionType, lastData }
|
({ pair, actionType, lastData }
|
||||||
: { pair: WhereWhatPair | null, actionType: string, lastData: { selector: string, action: string, tagName: string, innerText: string } }) => {
|
: { pair: WhereWhatPair | null, actionType: string, lastData: { selector: string, action: string, tagName: string, innerText: string } }) => {
|
||||||
const { selector, action } = lastData;
|
const { selector, action, tagName, innerText } = lastData;
|
||||||
setDecisionModal((prevState) => {
|
setDecisionModal((prevState) => {
|
||||||
return {
|
return {
|
||||||
pair,
|
pair,
|
||||||
actionType,
|
actionType,
|
||||||
selector,
|
selector,
|
||||||
action,
|
action,
|
||||||
|
tagName,
|
||||||
|
innerText,
|
||||||
open: true,
|
open: true,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -66,7 +68,7 @@ export const InterpretationButtons = ({ enableStepping }: InterpretationButtonsP
|
|||||||
const handleDecision = (decision: boolean) => {
|
const handleDecision = (decision: boolean) => {
|
||||||
const { pair, actionType } = decisionModal;
|
const { pair, actionType } = decisionModal;
|
||||||
socket?.emit('decision', { pair, actionType, decision });
|
socket?.emit('decision', { pair, actionType, decision });
|
||||||
setDecisionModal({ pair: null, actionType: '', selector: '', action: '', open: false });
|
setDecisionModal({ pair: null, actionType: '', selector: '', action: '', tagName: '', innerText: '', open: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDescription = () => {
|
const handleDescription = () => {
|
||||||
@@ -80,6 +82,8 @@ export const InterpretationButtons = ({ enableStepping }: InterpretationButtonsP
|
|||||||
<Box style={{ marginTop: '4px' }}>
|
<Box style={{ marginTop: '4px' }}>
|
||||||
[previous action: <b>{decisionModal.action}</b>]
|
[previous action: <b>{decisionModal.action}</b>]
|
||||||
<pre>{decisionModal.selector}</pre>
|
<pre>{decisionModal.selector}</pre>
|
||||||
|
<pre>{decisionModal.tagName}</pre>
|
||||||
|
<pre>{decisionModal.innerText}</pre>
|
||||||
</Box>
|
</Box>
|
||||||
</React.Fragment>);
|
</React.Fragment>);
|
||||||
default: return null;
|
default: return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user