1414 * limitations under the License.
1515 */
1616
17- import React , { ReactNode } from 'react' ;
17+ import React from 'react' ;
1818import { useNavigate } from 'react-router-dom' ;
1919
2020import { useRouteRef , useRouteRefParams } from '@backstage/core-plugin-api' ;
@@ -30,11 +30,7 @@ import {
3030import { usePermissionArrayDecision } from '../../hooks/usePermissionArray' ;
3131import { executeWorkflowRouteRef , workflowRouteRef } from '../../routes' ;
3232
33- interface Props {
34- children : ReactNode ;
35- }
36-
37- export const WorkflowPageTabContent = ( { children } : Props ) => {
33+ export const RunButton = ( ) => {
3834 const { workflowId } = useRouteRefParams ( workflowRouteRef ) ;
3935 const navigate = useNavigate ( ) ;
4036 const executeWorkflowLink = useRouteRef ( executeWorkflowRouteRef ) ;
@@ -49,35 +45,26 @@ export const WorkflowPageTabContent = ({ children }: Props) => {
4945 ] ) ;
5046
5147 return (
52- < Grid
53- container
54- spacing = { 2 }
55- direction = "column"
56- wrap = "nowrap"
57- justifyContent = "flex-end"
58- >
59- < Grid item container justifyContent = "flex-end" >
60- < Grid item >
61- { loadingPermission ? (
62- < Skeleton variant = "text" width = "5rem" />
63- ) : (
64- < Tooltip
65- title = "user not authorized to execute workflow"
66- disableHoverListener = { canRun }
48+ < Grid item container justifyContent = "flex-end" xs = { 12 } spacing = { 2 } >
49+ < Grid item >
50+ { loadingPermission ? (
51+ < Skeleton variant = "text" width = "5rem" />
52+ ) : (
53+ < Tooltip
54+ title = "user not authorized to execute workflow"
55+ disableHoverListener = { canRun }
56+ >
57+ < Button
58+ variant = "contained"
59+ color = "primary"
60+ onClick = { handleExecute }
61+ disabled = { ! canRun }
6762 >
68- < Button
69- variant = "contained"
70- color = "primary"
71- onClick = { handleExecute }
72- disabled = { ! canRun }
73- >
74- Run
75- </ Button >
76- </ Tooltip >
77- ) }
78- </ Grid >
63+ Run
64+ </ Button >
65+ </ Tooltip >
66+ ) }
7967 </ Grid >
80- { children }
8168 </ Grid >
8269 ) ;
8370} ;
0 commit comments