Handle nextdns no devices setup, data pending

pull/688/head
Michael Shamoon 2 years ago
parent fb2492e577
commit f7d5582f57

@ -372,5 +372,9 @@
"paperlessngx": {
"inbox": "Inbox",
"total": "Total"
},
"nextdns": {
"wait": "Please Wait",
"no_devices": "No Device Data Received"
}
}

@ -18,14 +18,22 @@ export default function Component({ service }) {
if (!nextdnsData) {
return (
<Container service={service}>
No data
<Block key="status" label="widget.status" value={t("nextdns.wait")} />
</Container>
);
}
if (!nextdnsData?.data?.length) {
return (
<Container service={service}>
<Block key="status" label="widget.status" value={t("nextdns.no_devices")} />
</Container>
);
}
return (
<Container service={service}>
{nextdnsData?.data?.map(d => <Block key={d.status} label={d.status} value={t("common.number", { value: d.queries })} />)}
{nextdnsData.data.map(d => <Block key={d.status} label={d.status} value={t("common.number", { value: d.queries })} />)}
</Container>
);
}

Loading…
Cancel
Save