updates on the validations on th action button in the substitution page

This commit is contained in:
2026-06-22 15:37:02 +05:30
parent f95d8ec70e
commit 25aaa46e5d

View File

@@ -1056,41 +1056,43 @@ const Riders = () => {
</Box>
</TableCell>
<TableCell align="right">
<Stack direction="row" spacing={0.75} justifyContent="flex-end">
<Tooltip title="Update substitution" placement="top">
<IconButton
size="small"
sx={{
bgcolor: soft(BRAND),
color: BRAND,
border: `1px solid ${edge(BRAND)}`,
'&:hover': { bgcolor: BRAND, color: '#fff' }
}}
onClick={() => {
setEditingSub(row);
setNewSubRider(null);
}}
>
<MdEdit size={14} />
</IconButton>
</Tooltip>
<Tooltip title="Delete substitution" placement="top">
<IconButton
size="small"
sx={{
bgcolor: soft('#ef4444'),
color: '#ef4444',
border: `1px solid ${edge('#ef4444')}`,
'&:hover': { bgcolor: '#ef4444', color: '#fff' }
}}
onClick={() => {
handleDeleteSubstitution(row);
}}
>
<MdDelete size={14} />
</IconButton>
</Tooltip>
</Stack>
{(row.status || '').toLowerCase() !== 'cancelled' && (
<Stack direction="row" spacing={0.75} justifyContent="flex-end">
<Tooltip title="Update substitution" placement="top">
<IconButton
size="small"
sx={{
bgcolor: soft(BRAND),
color: BRAND,
border: `1px solid ${edge(BRAND)}`,
'&:hover': { bgcolor: BRAND, color: '#fff' }
}}
onClick={() => {
setEditingSub(row);
setNewSubRider(null);
}}
>
<MdEdit size={14} />
</IconButton>
</Tooltip>
<Tooltip title="Delete substitution" placement="top">
<IconButton
size="small"
sx={{
bgcolor: soft('#ef4444'),
color: '#ef4444',
border: `1px solid ${edge('#ef4444')}`,
'&:hover': { bgcolor: '#ef4444', color: '#fff' }
}}
onClick={() => {
handleDeleteSubstitution(row);
}}
>
<MdDelete size={14} />
</IconButton>
</Tooltip>
</Stack>
)}
</TableCell>
</TableRow>
))}