From 5cd756c74238d14651b2e9eaba8e6af184a7d97a Mon Sep 17 00:00:00 2001 From: Rohit Date: Wed, 30 Apr 2025 21:39:55 +0530 Subject: [PATCH] feat: rm card componenent --- src/components/run/RunContent.tsx | 186 ------------------------------ 1 file changed, 186 deletions(-) diff --git a/src/components/run/RunContent.tsx b/src/components/run/RunContent.tsx index 350dc3bb..007e7f37 100644 --- a/src/components/run/RunContent.tsx +++ b/src/components/run/RunContent.tsx @@ -9,11 +9,6 @@ import { Accordion, AccordionSummary, AccordionDetails, - Card, - CardHeader, - CardContent, - Grid, - IconButton, Chip, ButtonGroup } from "@mui/material"; @@ -375,187 +370,6 @@ export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRe ); }; - const renderDataCard = ( - data: any[], - columns: string[], - title: string, - dataType: string, - csvFilename: string, - jsonFilename: string, - isPaginatedList: boolean = false - ) => { - if (!isPaginatedList && data.length === 0) return null; - if (isPaginatedList && (listData.length === 0 || currentListIndex >= listData.length)) return null; - - const currentData = isPaginatedList ? listData[currentListIndex] : data; - const currentColumns = isPaginatedList ? listColumns[currentListIndex] : columns; - - if (!currentData || currentData.length === 0) return null; - - const previewData = currentData.slice(0, 1); - const previewColumns = currentColumns.slice(0, 3); - - const showMoreColumns = currentColumns.length > 3; - - return ( - - - { - if (isPaginatedList) { - downloadCSV(currentData, currentColumns, `list_table_${currentListIndex + 1}.csv`); - } else { - downloadCSV(data, columns, csvFilename); - } - }} - title={t('run_content.captured_data.download_csv')} - > - - - { - if (isPaginatedList) { - downloadJSON(currentData, `list_table_${currentListIndex + 1}.json`); - } else { - downloadJSON(data, jsonFilename); - } - }} - title="Download JSON" - sx={{ mx: 0.5 }} - > - - - { - if (isPaginatedList) { - setExpandedView(`list-${currentListIndex}`); - } else { - setExpandedView(dataType); - } - }} - title={t('run_content.captured_data.view_full')} - > - - - - } - sx={{ pb: 1 }} - /> - - - {isPaginatedList ? ( - 1 - ? `Table ${currentListIndex + 1} of ${listData.length} (${currentData.length} ${currentData.length === 1 ? 'item' : 'items'})` - : `${currentData.length} ${currentData.length === 1 ? 'item' : 'items'}` - } - size="small" - sx={{ backgroundColor: '#FF00C3', color: 'white' }} - /> - ) : ( - - )} - - {isPaginatedList && listData.length > 1 && ( - - - - - )} - - - - - - {previewColumns.map((column) => ( - {column} - ))} - {showMoreColumns && ...} - - - - {previewData.map((row, index) => ( - - {previewColumns.map((column) => ( - - {row[column] === undefined || row[column] === "" ? "-" : row[column]} - - ))} - {showMoreColumns && ...} - - ))} - {currentData.length > 1 && ( - - - - - - )} - -
-
-
-
- ); - }; - const renderExpandedView = (dataTypeWithIndex: string) => { if (expandedView !== dataTypeWithIndex) return null;