mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +00:00
fix(frontend): add disabled attribute for category delete button
This commit is contained in:
parent
1398250e58
commit
7a19ba67e5
@ -156,29 +156,26 @@ export const Categories = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
) : null}
|
) : null}
|
||||||
{selectedCategories.length > 0 && (
|
<Button
|
||||||
<Grid item>
|
color="error"
|
||||||
<Button
|
variant="contained"
|
||||||
startIcon={<DeleteIcon />}
|
onClick={async () => {
|
||||||
variant="contained"
|
const isConfirmed = await dialogs.confirm(
|
||||||
color="error"
|
<ConfirmDialogBody
|
||||||
onClick={async () => {
|
mode="selection"
|
||||||
const isConfirmed = await dialogs.confirm(
|
itemsNumber={selectedCategories.length}
|
||||||
<ConfirmDialogBody
|
/>,
|
||||||
mode="selection"
|
);
|
||||||
itemsNumber={selectedCategories.length}
|
|
||||||
/>,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isConfirmed) {
|
if (isConfirmed) {
|
||||||
deleteCategories(selectedCategories);
|
deleteCategories(selectedCategories);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
disabled={!selectedCategories.length}
|
||||||
{t("button.delete")}
|
startIcon={<DeleteIcon />}
|
||||||
</Button>
|
>
|
||||||
</Grid>
|
{t("button.delete")}
|
||||||
)}
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
Reference in New Issue
Block a user