From 2e28f84b12c49880c9cbd831e60870c80abdd2c5 Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Sat, 21 Dec 2024 20:34:35 +0530 Subject: [PATCH] feat: add reset button for output preview --- .../molecules/InterpretationLog.tsx | 59 +++++++++++++++++-- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/src/components/molecules/InterpretationLog.tsx b/src/components/molecules/InterpretationLog.tsx index 0a771535..4d14bc51 100644 --- a/src/components/molecules/InterpretationLog.tsx +++ b/src/components/molecules/InterpretationLog.tsx @@ -94,6 +94,12 @@ export const InterpretationLog: React.FC = ({ isOpen, se setCustomValue(event.target.value); }; + const handleReset = () => { + setLog(''); + setTableData([]); + setBinaryData(null); + }; + useEffect(() => { socket?.on('log', handleLog); socket?.on('serializableCallback', handleSerializableCallback); @@ -172,12 +178,34 @@ export const InterpretationLog: React.FC = ({ isOpen, se > { binaryData ? ( -
- - {t('interpretation_log.titles.screenshot')} - - {t('interpretation_log.titles.screenshot')} -
+ <> +
+ + {t('interpretation_log.titles.screenshot')} + + {t('interpretation_log.titles.screenshot')} +
+ + ) : tableData.length > 0 ? ( <> @@ -203,6 +231,25 @@ export const InterpretationLog: React.FC = ({ isOpen, se {t('interpretation_log.messages.additional_rows')} + ) : (