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",
"missing": "Missing",
"suspended": "Suspended"
},
"spoolman": {
"loading": "Loading"
}
}

View File

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