Better handle loading blocks
This commit is contained in:
parent
8a67145648
commit
e588546a5a
@ -998,5 +998,8 @@
|
|||||||
"progressing": "Progressing",
|
"progressing": "Progressing",
|
||||||
"missing": "Missing",
|
"missing": "Missing",
|
||||||
"suspended": "Suspended"
|
"suspended": "Suspended"
|
||||||
|
},
|
||||||
|
"spoolman": {
|
||||||
|
"loading": "Loading"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user