feat: ui alignment for table & text

This commit is contained in:
karishmas6
2024-10-19 19:38:25 +05:30
parent a6fcf31f4b
commit ff1c7ebd22

View File

@@ -112,97 +112,99 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
}, [hasScrapeListAction, hasScrapeSchemaAction, hasScreenshotAction, setIsOpen]); }, [hasScrapeListAction, hasScrapeSchemaAction, hasScreenshotAction, setIsOpen]);
return ( return (
<Grid container> <Grid container>
<Grid item xs={12} md={9} lg={9}> <Grid item xs={12} md={9} lg={9}>
<Button <Button
onClick={toggleDrawer(true)} onClick={toggleDrawer(true)}
variant="contained" variant="contained"
color="primary" color="primary"
sx={{ sx={{
color: 'white', color: 'white',
position: 'fixed', position: 'fixed',
background: '#ff00c3', background: '#ff00c3',
border: 'none', border: 'none',
padding: '30px 20px', padding: '30px 20px',
width: 'calc(100% - 25%)', width: 'calc(100% - 25%)',
bottom: 0, bottom: 0,
overflow: 'hidden', overflow: 'hidden',
justifyContent: 'flex-start', textAlign: 'left',
'&:hover': { justifyContent: 'flex-start',
backgroundColor: '#ff00c3', '&:hover': {
}, backgroundColor: '#ff00c3',
}} },
>
Output Data Preview
</Button>
<SwipeableDrawer
anchor="bottom"
open={isOpen}
onClose={toggleDrawer(false)}
onOpen={toggleDrawer(true)}
PaperProps={{
sx: {
background: 'white',
color: 'black',
padding: '10px',
height: 500,
width: width - 10,
display: 'flex',
},
}}
>
<Typography variant="h6" gutterBottom>
<StorageIcon /> Output Data Preview
</Typography>
<div
style={{
height: '50vh',
overflow: 'none',
padding: '10px',
}} }}
> >
<TableContainer component={Paper}> Output Data Preview
<Table sx={{ minWidth: 650 }} stickyHeader aria-label="output data table"> </Button>
<TableHead> <SwipeableDrawer
<TableRow> anchor="bottom"
{columns.length > 0 ? ( open={isOpen}
columns.map((column) => ( onClose={toggleDrawer(false)}
<TableCell key={column}>{column}</TableCell> onOpen={toggleDrawer(true)}
)) PaperProps={{
) : ""} sx: {
</TableRow> background: 'white',
</TableHead> color: 'black',
{tableData.length > 0 ? ( padding: '10px',
tableData.map((row, index) => ( height: 500,
<TableBody> width: width - 10,
<TableRow key={index}> display: 'flex',
},
}}
>
<Typography variant="h6" gutterBottom>
<StorageIcon /> Output Data Preview
</Typography>
<div
style={{
height: '50vh',
overflow: 'none',
padding: '10px',
}}
>
{tableData.length > 0 ? (
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} stickyHeader aria-label="output data table">
<TableHead>
<TableRow>
{columns.map((column) => ( {columns.map((column) => (
<TableCell key={column}>{row[column]}</TableCell> <TableCell key={column}>{column}</TableCell>
))} ))}
</TableRow> </TableRow>
</TableHead>
<TableBody>
{tableData.map((row, index) => (
<TableRow key={index}>
{columns.map((column) => (
<TableCell key={column}>{row[column]}</TableCell>
))}
</TableRow>
))}
</TableBody> </TableBody>
)) </Table>
) : ( </TableContainer>
hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction ? ( ) : (
<> <Grid container justifyContent="center" alignItems="center" style={{ height: '100%' }}>
<Typography variant="h6" gutterBottom> <Grid item>
You've successfully trained the robot to perform actions! Click on the button below to get a preview of data your robot will extract. {hasScrapeListAction || hasScrapeSchemaAction || hasScreenshotAction ? (
<>
<Typography variant="h6" gutterBottom align="center">
You've successfully trained the robot to perform actions! Click on the button below to get a preview of the data your robot will extract.
</Typography>
<SidePanelHeader />
</>
) : (
<Typography variant="h6" gutterBottom 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.
</Typography> </Typography>
<SidePanelHeader /> )}
</> </Grid>
) : ( </Grid>
<Typography variant="h6" gutterBottom> )}
It looks like you have not selected anything for extraction yet. Once you do, the robot will show a preview of your selections here. <div style={{ float: 'left', clear: 'both' }} ref={logEndRef} />
</Typography> </div>
) </SwipeableDrawer>
)} </Grid>
</Table>
</TableContainer>
<div style={{ float: 'left', clear: 'both' }} ref={logEndRef} />
</div>
</SwipeableDrawer>
</Grid> </Grid>
</Grid> );
);
} }