diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index c3166720..f0074adb 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -57,6 +57,9 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const [listColumns, setListColumns] = useState([]); const [currentListIndex, setCurrentListIndex] = useState(0); + const [screenshotKeys, setScreenshotKeys] = useState([]); + const [currentScreenshotIndex, setCurrentScreenshotIndex] = useState(0); + const [expandedView, setExpandedView] = useState(null); const [legacyData, setLegacyData] = useState([]); @@ -90,6 +93,13 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe } }, [row.serializableOutput]); + useEffect(() => { + if (row.binaryOutput && Object.keys(row.binaryOutput).length > 0) { + setScreenshotKeys(Object.keys(row.binaryOutput)); + setCurrentScreenshotIndex(0); + } + }, [row.binaryOutput]); + const processLegacyData = (legacyOutput: Record) => { let allData: any[] = []; @@ -240,6 +250,14 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe } }; + const navigateScreenshots = (direction: 'next' | 'prev') => { + if (direction === 'next' && currentScreenshotIndex < screenshotKeys.length - 1) { + setCurrentScreenshotIndex(currentScreenshotIndex + 1); + } else if (direction === 'prev' && currentScreenshotIndex > 0) { + setCurrentScreenshotIndex(currentScreenshotIndex - 1); + } + }; + const renderDataTable = ( data: any[], columns: string[], @@ -789,11 +807,90 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe )} - {/* {hasScreenshots && ( + {hasScreenshots && ( <> - {renderPaginatedScreenshots()} + + } + aria-controls="screenshot-content" + id="screenshot-header" + > + + + + {t('run_content.captured_screenshot.title', 'Screenshots')} + + + + + + + + {screenshotKeys.length > 1 && ( + + + + + )} + + + + {screenshotKeys.length > 1 && ( + + )} + + {`Screenshot + + + + - )} */} + )}