fix: remove enable disable settings

This commit is contained in:
karishmas6
2024-10-22 20:34:50 +05:30
parent 2f719daae5
commit 55bc4147ba

View File

@@ -85,6 +85,10 @@ export const ScheduleSettingsModal = ({ isOpen, handleStart, handleClose, initia
handleStart(settings); handleStart(settings);
}; };
const deleteSchedule = () => {
};
return ( return (
<GenericModal <GenericModal
isOpen={isOpen} isOpen={isOpen}
@@ -99,19 +103,6 @@ export const ScheduleSettingsModal = ({ isOpen, handleStart, handleClose, initia
'& > *': { marginBottom: '20px' }, '& > *': { marginBottom: '20px' },
}}> }}>
<Typography variant="h6" sx={{ marginBottom: '20px' }}>Schedule Settings</Typography> <Typography variant="h6" sx={{ marginBottom: '20px' }}>Schedule Settings</Typography>
<FormControlLabel
control={
<Switch
checked={settings.enabled}
onChange={(e) => handleChange('enabled', e.target.checked)}
color="primary"
/>
}
label="Enable Scheduling"
/>
{settings.enabled && (
<> <>
<Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}> <Box sx={{ display: 'flex', alignItems: 'center', width: '100%' }}>
<Typography sx={{ marginRight: '10px' }}>Run once every</Typography> <Typography sx={{ marginRight: '10px' }}>Run once every</Typography>
@@ -195,23 +186,25 @@ export const ScheduleSettingsModal = ({ isOpen, handleStart, handleClose, initia
</Dropdown> </Dropdown>
</Box> </Box>
</> </>
)}
{/* {settings.enabled && ( <Box mt={2} display="flex" justifyContent="space-between">
<Typography variant="body2" color="text.secondary" sx={{ mt: 2 }}> <Button
{initialSettings?.nextRunAt && ( onClick={deleteSchedule}
`Next scheduled run: ${new Date(initialSettings.nextRunAt).toLocaleString()}` variant="outlined"
)} color="secondary"
</Typography> >
)} */} Delete Schedule
</Button>
</Box>
<Button <Box mt={2} display="flex" justifyContent="flex-end">
variant="contained" <Button onClick={handleClose} color="primary">
onClick={handleSubmit} Cancel
color={settings.enabled ? 'primary' : 'secondary'} </Button>
> <Button onClick={() => handleStart(settings)} variant="contained" color="primary" style={{ marginLeft: '10px' }}>
{settings.enabled ? 'Schedule' : 'Disable Schedule'} Save Schedule
</Button> </Button>
</Box>
</Box> </Box>
</GenericModal> </GenericModal>
); );