Better handle loading blocks

This commit is contained in:
shamoon 2024-11-21 15:29:40 -08:00
parent 8a67145648
commit e588546a5a
2 changed files with 8 additions and 2 deletions

View File

@ -998,5 +998,8 @@
"progressing": "Progressing", "progressing": "Progressing",
"missing": "Missing", "missing": "Missing",
"suspended": "Suspended" "suspended": "Suspended"
},
"spoolman": {
"loading": "Loading"
} }
} }

View File

@ -16,10 +16,13 @@ export default function Component({ service }) {
} }
if (!spoolData) { if (!spoolData) {
const nBlocksGuess = widget.spoolIds?.length ?? 4;
return ( return (
<Container service={service}> <Container service={service}>
<Block label="spoolman.spool1" /> {[...Array(nBlocksGuess)].map((_, i) => (
<Block label="spoolman.spool2" /> // eslint-disable-next-line react/no-array-index-key
<Block key={i} label="spoolman.loading" />
))}
</Container> </Container>
); );
} }