feat: empty table

This commit is contained in:
karishmas6
2024-10-19 10:00:26 +05:30
parent 4257f382c4
commit 13ec9e1cd5

View File

@@ -120,7 +120,8 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
textAlign: 'left', textAlign: 'left',
bottom: 0, bottom: 0,
overflow: 'hidden', overflow: 'hidden',
}}> }}
>
Interpretation Log Interpretation Log
</button> </button>
<SwipeableDrawer <SwipeableDrawer
@@ -135,48 +136,57 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
padding: '10px', padding: '10px',
height: 500, height: 500,
width: width - 10, width: width - 10,
display: 'flex' display: 'flex',
} },
}} }}
> >
<Typography variant="h6" gutterBottom> <Typography variant="h6" gutterBottom>
<StorageIcon /> Output Data Preview <StorageIcon /> Output Data Preview
</Typography> </Typography>
<div style={{ <div
style={{
height: '50vh', height: '50vh',
overflow: 'none', overflow: 'none',
padding: '10px', padding: '10px',
}}> }}
{/* <Highlight className="javascript"> >
{log}
</Highlight> */}
{tableData.length > 0 && (
<TableContainer component={Paper}> <TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} stickyHeader aria-label="output data table"> <Table sx={{ minWidth: 650 }} stickyHeader aria-label="output data table">
<TableHead> <TableHead>
<TableRow> <TableRow>
{columns.map((column) => ( {columns.length > 0 ? (
columns.map((column) => (
<TableCell key={column}>{column}</TableCell> <TableCell key={column}>{column}</TableCell>
))} ))
) : (
<TableCell align="center">No Data</TableCell>
)}
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
{tableData.map((row, index) => ( {tableData.length > 0 ? (
tableData.map((row, index) => (
<TableRow key={index}> <TableRow key={index}>
{columns.map((column) => ( {columns.map((column) => (
<TableCell key={column}>{row[column]}</TableCell> <TableCell key={column}>{row[column]}</TableCell>
))} ))}
</TableRow> </TableRow>
))} ))
) : (
<TableRow>
<TableCell colSpan={columns.length || 1} align="center">
It looks like you have not selected anything for extraction yet. Once you do, the robot will show a preview of your selections here.
</TableCell>
</TableRow>
)}
</TableBody> </TableBody>
</Table> </Table>
</TableContainer> </TableContainer>
)} <div style={{ float: 'left', clear: 'both' }} ref={logEndRef} />
<div style={{ float: "left", clear: "both" }}
ref={logEndRef} />
</div> </div>
</SwipeableDrawer> </SwipeableDrawer>
</Grid> </Grid>
</Grid> </Grid>
); );
} }