feat(wip): ui for limit

This commit is contained in:
karishmas6
2024-09-08 12:22:33 +05:30
parent b19b05438e
commit 4f81ad297b

View File

@@ -246,21 +246,20 @@ export const RightSidePanel: React.FC<RightSidePanelProps> = ({ onFinishCapture
</Box> </Box>
)} )}
{showLimitOptions && ( {limitMode && (
<Box display="flex" flexDirection="column" gap={2} style={{ margin: '15px' }}>
<FormControl> <FormControl>
<FormLabel> <FormLabel>
<h4>What is the maximum number of rows you want to extract?</h4> <h4>What is the maximum number of rows you want to extract?</h4>
</FormLabel> </FormLabel>
<RadioGroup row value={selectedLimit} onChange={handleLimitChange} sx={{ width: '500px' }}> <RadioGroup row value={limitType} onChange={(e) => updateLimitType(e.target.value as LimitType)} sx={{ width: '500px' }}>
<FormControlLabel value="10" control={<Radio />} label="10" /> <FormControlLabel value="10" control={<Radio />} label="10" />
<FormControlLabel value="100" control={<Radio />} label="100" /> <FormControlLabel value="100" control={<Radio />} label="100" />
<FormControlLabel value="custom" control={<Radio />} label="Custom" /> <FormControlLabel value="custom" control={<Radio />} label="Custom" />
{selectedLimit === 'custom' && ( {limitType === 'custom' && (
<TextField <TextField
type="number" type="number"
value={customLimit} value={customLimit}
onChange={handleCustomLimitChange} onChange={(e) => updateCustomLimit(e.target.value)}
placeholder="Enter number" placeholder="Enter number"
sx={{ sx={{
marginLeft: '10px', marginLeft: '10px',
@@ -273,8 +272,7 @@ export const RightSidePanel: React.FC<RightSidePanelProps> = ({ onFinishCapture
)} )}
</RadioGroup> </RadioGroup>
</FormControl> </FormControl>
<Button variant="contained" onClick={handleConfirmListCapture}>Confirm Limit</Button>
</Box>
)} )}
{!getText && !getScreenshot && !getList && <Button variant="contained" onClick={startGetText}>Capture Text</Button>} {!getText && !getScreenshot && !getList && <Button variant="contained" onClick={startGetText}>Capture Text</Button>}