diff --git a/src/cmem/ActivityControl/ActivityControlWidget.tsx b/src/cmem/ActivityControl/ActivityControlWidget.tsx index ec7b3d92..319889e7 100644 --- a/src/cmem/ActivityControl/ActivityControlWidget.tsx +++ b/src/cmem/ActivityControl/ActivityControlWidget.tsx @@ -222,42 +222,11 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) { data-test-id={dataTestIdLegacy ? `${dataTestIdLegacy}-actions` : undefined} > {activityActions && - activityActions.map((action, idx) => { - const actionButtonRef = React.useRef(null); - const ActionButton = () => ( - - ) - return action.notification ? - <> - - - - {actionButtonRef.current && ( - - - - )} - : - - })} + activityActions.map((action, idx) => + )} {additionalActions} {activityContextMenu && activityContextMenu.menuItems.length > 0 && ( {widget} ); } + +interface ActivityActionButtonProps { + action: ActivityControlWidgetAction +} + +const ActivityActionButton = ({action}: ActivityActionButtonProps) => { + const actionButtonRef = React.useRef(null); + const ActionButton = () => ( + + ) + return action.notification ? + <> + + + + {actionButtonRef.current && ( + + + + )} + : + +}