File tree Expand file tree Collapse file tree
src/components/solvers/Graph Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import {
1414 Tooltip ,
1515 VStack ,
1616} from "@chakra-ui/react" ;
17- import { ReactNode } from "react" ;
17+ import { ReactNode , useState } from "react" ;
1818import { FaQuestionCircle } from "react-icons/fa" ;
1919import { PiGraph } from "react-icons/pi" ;
2020import { MetaSolverStrategyDto } from "../../../api/strategy/data-model/MetaSolverStrategyDto" ;
@@ -28,6 +28,8 @@ export interface StrategyNodeContentProps {
2828}
2929
3030export const StrategyNodeContent = ( props : StrategyNodeContentProps ) => {
31+ const [ isRunning , setIsRunning ] = useState < boolean > ( false ) ;
32+
3133 return (
3234 < VStack gap = "0px" >
3335 < HStack align = "start" maxW = "10rem" justifyContent = "space-between" gap = "0" >
@@ -79,16 +81,20 @@ export const StrategyNodeContent = (props: StrategyNodeContentProps) => {
7981 textColor = "white"
8082 fontWeight = "bold"
8183 fontSize = "small"
84+ isDisabled = { isRunning }
8285 _hover = { {
8386 bg : props . button . callback ? "kitBlueAlpha" : "kitBlue" ,
8487 } }
8588 border = "1px"
8689 borderColor = "black"
8790 borderRadius = "0.25rem"
8891 paddingY = "1px"
89- onClick = { props . button . callback }
92+ onClick = { ( ) => {
93+ setIsRunning ( true ) ;
94+ props . button . callback ?.( ) ;
95+ } }
9096 >
91- { props . button . label }
97+ { isRunning ? "Running..." : props . button . label }
9298 </ Button >
9399 </ div >
94100 </ VStack >
You can’t perform that action at this time.
0 commit comments