diff --git a/src/components/Dashboard/common/ObjectActions.jsx b/src/components/Dashboard/common/ObjectActions.jsx index 39495ef..cbe80f5 100644 --- a/src/components/Dashboard/common/ObjectActions.jsx +++ b/src/components/Dashboard/common/ObjectActions.jsx @@ -14,6 +14,7 @@ function mapActionsToMenuItems(actions, currentUrlWithActions, id) { const item = { key: action.key || action.name, label: action.label, + danger: action?.danger || false, icon: action.icon ? React.createElement(action.icon) : undefined, disabled: actionUrl && actionUrl === currentUrlWithActions } @@ -53,11 +54,10 @@ const ObjectActions = ({ location.search ) - console.log('curr url', currentUrlWithoutActions) - - // Filter out actions whose url matches currentUrl const filteredActions = actions.filter( - (action) => !(action.url(id) && action.url(id) === currentUrlWithoutActions) + (action) => + typeof action.url !== 'function' || + action.url(id) !== currentUrlWithoutActions ) const currentUrlWithActions = location.pathname + location.search