diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 25eb5063..2ad3be11 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -27,6 +27,7 @@ import TableHead from '@mui/material/TableHead'; import TableRow from '@mui/material/TableRow'; import 'highlight.js/styles/github.css'; import { useTranslation } from "react-i18next"; +import { useThemeMode } from "../../context/theme-provider"; interface RunContentProps { row: Data, @@ -54,6 +55,8 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe const [legacyColumns, setLegacyColumns] = useState([]); const [isLegacyData, setIsLegacyData] = useState(false); + const { darkMode } = useThemeMode(); + useEffect(() => { setTab(tab); }, [interpretationInProgress]); @@ -262,8 +265,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe if (!currentData || currentData.length === 0) return null; - const downloadData = isPaginatedList ? currentData : data; - const downloadColumns = isPaginatedList ? currentColumns : columns; + const isSchemaData = title.toLowerCase().includes('text') || title.toLowerCase().includes('schema'); return ( @@ -283,7 +285,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe @@ -338,6 +340,7 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe onClick={() => navigateListTable('next')} disabled={currentListIndex === listData.length - 1} sx={{ + borderColor: '#FF00C3', color: currentListIndex === listData.length - 1 ? 'gray' : '#FF00C3', '&.Mui-disabled': { borderColor: 'rgba(0, 0, 0, 0.12)' @@ -353,21 +356,66 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe - {(isPaginatedList ? currentColumns : columns).map((column) => ( - {column} - ))} + {isSchemaData ? ( + <> + + Label + + + Value + + + ) : ( + (isPaginatedList ? currentColumns : columns).map((column) => ( + + {column} + + )) + )} - {(isPaginatedList ? currentData : data).map((row, index) => ( - - {(isPaginatedList ? currentColumns : columns).map((column) => ( - - {row[column] === undefined || row[column] === "" ? "-" : row[column]} + {isSchemaData ? ( + currentColumns.map((column) => ( + + + {column} - ))} - - ))} + + {currentData[0][column] === undefined || currentData[0][column] === "" ? "-" : currentData[0][column]} + + + )) + ) : ( + currentData.map((row, index) => ( + + {(isPaginatedList ? currentColumns : columns).map((column) => ( + + {row[column] === undefined || row[column] === "" ? "-" : row[column]} + + ))} + + )) + )}