pixelass commited on
Commit
0391bdb
·
unverified ·
1 Parent(s): 6eb9dcb

feat: better loading state

Browse files
Files changed (1) hide show
  1. src/pages/index.tsx +4 -3
src/pages/index.tsx CHANGED
@@ -10,7 +10,6 @@ import VisibilityIcon from "@mui/icons-material/Visibility";
10
  import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
11
  import DeleteForeverIcon from "@mui/icons-material/DeleteForever";
12
  import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
13
- import HourglassTopIcon from "@mui/icons-material/HourglassTop";
14
  import PlayArrowIcon from "@mui/icons-material/PlayArrow";
15
  import ReplayIcon from "@mui/icons-material/Replay";
16
  import TextField from "@mui/material/TextField";
@@ -179,10 +178,12 @@ export default function Home() {
179
  aria-disabled={loading}
180
  disabled={loading}
181
  >
182
- {loading ? <HourglassTopIcon /> : <PlayArrowIcon />}
183
  </IconButton>
184
  <Typography sx={{ flex: 1 }}>
185
- {current?.task} - {current?.id ?? ""}
 
 
186
  </Typography>
187
  <IconButton
188
  edge="end"
 
10
  import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
11
  import DeleteForeverIcon from "@mui/icons-material/DeleteForever";
12
  import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
 
13
  import PlayArrowIcon from "@mui/icons-material/PlayArrow";
14
  import ReplayIcon from "@mui/icons-material/Replay";
15
  import TextField from "@mui/material/TextField";
 
178
  aria-disabled={loading}
179
  disabled={loading}
180
  >
181
+ {loading ? <CircularProgress size={24} /> : <PlayArrowIcon />}
182
  </IconButton>
183
  <Typography sx={{ flex: 1 }}>
184
+ {loading
185
+ ? "Loading …"
186
+ : `${current?.task} - ${current?.id ?? ""}`}
187
  </Typography>
188
  <IconButton
189
  edge="end"