From fd99b6453772f33b09f93dcb242dad716f9b6d11 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 23 Sep 2024 17:29:23 +0530 Subject: [PATCH] feat: display in ui --- src/components/molecules/InterpretationButtons.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/molecules/InterpretationButtons.tsx b/src/components/molecules/InterpretationButtons.tsx index 0e6a9e2a..99c575cb 100644 --- a/src/components/molecules/InterpretationButtons.tsx +++ b/src/components/molecules/InterpretationButtons.tsx @@ -51,13 +51,15 @@ export const InterpretationButtons = ({ enableStepping }: InterpretationButtonsP const decisionHandler = useCallback( ({ pair, actionType, lastData } : { 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) => { return { pair, actionType, selector, action, + tagName, + innerText, open: true, } }) @@ -66,7 +68,7 @@ export const InterpretationButtons = ({ enableStepping }: InterpretationButtonsP const handleDecision = (decision: boolean) => { const { pair, actionType } = decisionModal; 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 = () => { @@ -80,6 +82,8 @@ export const InterpretationButtons = ({ enableStepping }: InterpretationButtonsP [previous action: {decisionModal.action}]
{decisionModal.selector}
+
{decisionModal.tagName}
+
{decisionModal.innerText}
); default: return null;