Skip to content

Commit df30cc1

Browse files
committed
feat: show running when the strategy is first selected
1 parent fb6b203 commit df30cc1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/components/solvers/Graph/StrategyNodeContent.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff 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";
1818
import { FaQuestionCircle } from "react-icons/fa";
1919
import { PiGraph } from "react-icons/pi";
2020
import { MetaSolverStrategyDto } from "../../../api/strategy/data-model/MetaSolverStrategyDto";
@@ -28,6 +28,8 @@ export interface StrategyNodeContentProps {
2828
}
2929

3030
export 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>

0 commit comments

Comments
 (0)