@@ -52,7 +52,7 @@ export interface ActivityControlWidgetProps extends TestableComponent {
5252 /**
5353 * The action buttons
5454 */
55- activityActions ?: ( ActivityControlWidgetAction | React . ReactElement ) [ ] ;
55+ activityActions ?: ActivityControlWidgetAction [ ] ;
5656 /**
5757 * Context menu items
5858 */
@@ -90,12 +90,6 @@ interface IActivityContextMenu extends TestableComponent {
9090 menuItems : IActivityMenuAction [ ] ;
9191}
9292
93- const isActivityControlWidgetAction = (
94- value : ActivityControlWidgetAction | React . ReactElement
95- ) : value is ActivityControlWidgetAction => {
96- return ! ! ( ( value as ActivityControlWidgetAction ) . action && ( value as ActivityControlWidgetAction ) . icon ) ;
97- } ;
98-
9993export interface ActivityControlWidgetAction extends TestableComponent {
10094 // The action that should be triggered
10195 action : ( ) => void ;
@@ -184,25 +178,21 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
184178 < OverviewItemActions >
185179 { activityActions &&
186180 activityActions . map ( ( action , idx ) => {
187- if ( isActivityControlWidgetAction ( action ) ) {
188- return (
189- < IconButton
190- key = { typeof action . icon === "string" ? action . icon : action [ "data-test-id" ] ?? idx }
191- data-test-id = { action [ "data-test-id" ] }
192- name = { action . icon }
193- text = { action . tooltip }
194- onClick = { action . action }
195- disabled = { action . disabled }
196- intent = { action . hasStateWarning ? "warning" : undefined }
197- tooltipProps = { {
198- hoverOpenDelay : 200 ,
199- placement : "bottom" ,
200- } }
201- />
202- ) ;
203- }
204-
205- return action ;
181+ return (
182+ < IconButton
183+ key = { typeof action . icon === "string" ? action . icon : action [ "data-test-id" ] ?? idx }
184+ data-test-id = { action [ "data-test-id" ] }
185+ name = { action . icon }
186+ text = { action . tooltip }
187+ onClick = { action . action }
188+ disabled = { action . disabled }
189+ hasStateWarning = { action . hasStateWarning }
190+ tooltipProps = { {
191+ hoverOpenDelay : 200 ,
192+ placement : "bottom" ,
193+ } }
194+ />
195+ ) ;
206196 } ) }
207197 { activityContextMenu && activityContextMenu . menuItems . length > 0 && (
208198 < ContextMenu
0 commit comments