Skip to content

Commit 88ff32b

Browse files
committed
add abort button
1 parent 45a0947 commit 88ff32b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/components/AbortButton.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Button } from "@mui/material";
2+
3+
import { setWorkerState, type WorkerRequest } from "../utils/api";
4+
5+
const AbortButton = () => {
6+
return (
7+
<Button
8+
variant="contained"
9+
color="error"
10+
sx={{ width: "150px" }}
11+
onClick={async () => {
12+
const workerRequest: WorkerRequest = {
13+
new_state: "ABORTING",
14+
defer: false,
15+
reason: "UI Intervention",
16+
};
17+
await setWorkerState(workerRequest);
18+
}}
19+
>
20+
Abort
21+
</Button>
22+
);
23+
};
24+
25+
export default AbortButton;

0 commit comments

Comments
 (0)