Skip to content

Commit a14d8cf

Browse files
committed
Use typography for workerStatus
1 parent 7665cad commit a14d8cf

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

src/blueapi/BlueapiComponents.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
Tooltip,
99
} from "@mui/material";
1010

11+
export function RunPlanButton() {}
12+
1113
export function AbortButton() {
1214
const [openMsg, setOpenMsg] = React.useState<boolean>(false);
1315

src/components/WorkerStatus.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1-
import { Box, Grid2, Stack } from "@mui/material";
1+
import { Grid2, Stack, Typography } from "@mui/material";
22

33
import { processUseBlueApiCall, useBlueApiCall } from "../blueapi/blueapi";
44
import { useState } from "react";
55

66
export function WorkerStatus() {
77
const [currentState, setCurrentState] = useState<string>("UNKNOWN");
88
const workerStateInfo = useBlueApiCall("/worker/state");
9+
10+
const readCurrentState = () => {
11+
return processUseBlueApiCall(workerStateInfo, (res) => {
12+
if (!res.bodyUsed) {
13+
res.json().then((text) => setCurrentState(text));
14+
}
15+
return currentState;
16+
});
17+
};
18+
919
return (
1020
<Grid2 size={12}>
1121
<Stack direction={"row"} spacing={1} justifyContent={"center"}>
12-
<b>BlueAPI worker status: </b>
13-
<Box>
14-
{processUseBlueApiCall(workerStateInfo, (res) => {
15-
if (!res.bodyUsed) {
16-
res.json().then((text) => setCurrentState(text));
17-
}
18-
return currentState;
19-
})}
20-
</Box>
22+
<Typography variant="body1" fontWeight={"bold"}>
23+
BlueAPI worker status:
24+
</Typography>
25+
<Typography variant="body1">{readCurrentState()}</Typography>
2126
</Stack>
2227
</Grid2>
2328
);

0 commit comments

Comments
 (0)