aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/components/CollectionActions.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/settings/components/CollectionActions.js')
-rw-r--r--modern/src/settings/components/CollectionActions.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/modern/src/settings/components/CollectionActions.js b/modern/src/settings/components/CollectionActions.js
index e40b3eaa..b84d8f0f 100644
--- a/modern/src/settings/components/CollectionActions.js
+++ b/modern/src/settings/components/CollectionActions.js
@@ -17,7 +17,7 @@ const useStyles = makeStyles(() => ({
}));
const CollectionActions = ({
- itemId, editPath, endpoint, setTimestamp, customAction,
+ itemId, editPath, endpoint, setTimestamp, customActions,
}) => {
const theme = useTheme();
const classes = useStyles();
@@ -39,8 +39,8 @@ const CollectionActions = ({
setMenuAnchorEl(null);
};
- const handleCustom = () => {
- customAction.handler(itemId);
+ const handleCustom = (action) => {
+ action.handler(itemId);
setMenuAnchorEl(null);
};
@@ -59,20 +59,20 @@ const CollectionActions = ({
<MoreVertIcon fontSize="small" />
</IconButton>
<Menu open={!!menuAnchorEl} anchorEl={menuAnchorEl} onClose={() => setMenuAnchorEl(null)}>
- {customAction && (
- <MenuItem onClick={handleCustom}>{customAction.title}</MenuItem>
- )}
+ {customActions && customActions.map((action) => (
+ <MenuItem onClick={() => handleCustom(action)} key={action.key}>{action.title}</MenuItem>
+ ))}
<MenuItem onClick={handleEdit}>{t('sharedEdit')}</MenuItem>
<MenuItem onClick={handleRemove}>{t('sharedRemove')}</MenuItem>
</Menu>
</>
) : (
<div className={classes.row}>
- {customAction && (
- <IconButton size="small" onClick={handleCustom}>
- {customAction.icon}
+ {customActions && customActions.map((action) => (
+ <IconButton size="small" onClick={() => handleCustom(action)} key={action.key}>
+ {action.icon}
</IconButton>
- )}
+ ))}
<IconButton size="small" onClick={handleEdit}>
<EditIcon fontSize="small" />
</IconButton>