@@ -52,7 +52,7 @@ export interface ActivityControlWidgetProps extends TestableComponent {
5252 /**
5353 * The action buttons
5454 */
55- activityActions ?: ActivityControlWidgetAction [ ] ;
55+ activityActions ?: ( ActivityControlWidgetAction | React . ReactElement ) [ ] ;
5656 /**
5757 * Context menu items
5858 */
@@ -90,6 +90,12 @@ 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+
9399export interface ActivityControlWidgetAction extends TestableComponent {
94100 // The action that should be triggered
95101 action : ( ) => void ;
@@ -178,21 +184,25 @@ export function ActivityControlWidget(props: ActivityControlWidgetProps) {
178184 < OverviewItemActions >
179185 { activityActions &&
180186 activityActions . map ( ( action , idx ) => {
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- ) ;
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 ;
196206 } ) }
197207 { activityContextMenu && activityContextMenu . menuItems . length > 0 && (
198208 < ContextMenu
0 commit comments