@@ -19,9 +19,8 @@ import {
19
19
import { Stats , StatsItem } from "components/Stats/Stats" ;
20
20
import { createDayString } from "utils/createDayString" ;
21
21
import { DashboardFullPage } from "components/Dashboard/DashboardLayout" ;
22
- import { LoadingButton } from "@mui/lab" ;
23
22
import ReplayIcon from "@mui/icons-material/Replay" ;
24
- import { FC } from "react " ;
23
+ import IconButton from "@mui/material/IconButton " ;
25
24
import { health , refreshHealth } from "api/queries/debug" ;
26
25
27
26
const sections = {
@@ -111,15 +110,34 @@ export function HealthPageView({
111
110
< StatsItem
112
111
css = { styles . statsItem }
113
112
label = "Last check"
114
- value = { createDayString ( healthStatus . time ) }
113
+ value = {
114
+ < span css = { styles . statsItem } >
115
+ { createDayString ( healthStatus . time ) }
116
+ < IconButton
117
+ disabled = { isRefreshing }
118
+ size = "small"
119
+ title = "Refresh health data"
120
+ onClick = { forceRefresh }
121
+ sx = { {
122
+ width : 16 ,
123
+ height : 16 ,
124
+ "& svg.MuiSvgIcon-root" : {
125
+ width : 16 ,
126
+ height : 16 ,
127
+ } ,
128
+ } }
129
+ >
130
+ < ReplayIcon />
131
+ </ IconButton >
132
+ </ span >
133
+ }
115
134
/>
116
135
< StatsItem
117
136
css = { styles . statsItem }
118
137
label = "Coder version"
119
138
value = { healthStatus . coder_version }
120
139
/>
121
140
</ Stats >
122
- < RefreshButton loading = { isRefreshing } handleAction = { forceRefresh } />
123
141
</ FullWidthPageHeader >
124
142
< Box
125
143
sx = { {
@@ -254,25 +272,3 @@ const styles = {
254
272
} ,
255
273
} ,
256
274
} satisfies Record < string , Interpolation < Theme > > ;
257
-
258
- interface HealthcheckAction {
259
- handleAction : ( ) => void ;
260
- loading : boolean ;
261
- }
262
-
263
- export const RefreshButton : FC < HealthcheckAction > = ( {
264
- handleAction,
265
- loading,
266
- } ) => {
267
- return (
268
- < LoadingButton
269
- loading = { loading }
270
- loadingPosition = "start"
271
- data-testid = "healthcheck-refresh-button"
272
- startIcon = { < ReplayIcon /> }
273
- onClick = { handleAction }
274
- >
275
- Refresh
276
- </ LoadingButton >
277
- ) ;
278
- } ;
0 commit comments