mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-16 17:59:49 +00:00
further restructuring
This commit is contained in:
parent
9b07f3eb90
commit
4386999c38
55 changed files with 224 additions and 224 deletions
|
@ -1,8 +1,8 @@
|
|||
import useSWR from "swr";
|
||||
import { useTranslation } from "next-i18next";
|
||||
|
||||
import Widget from "components/services/widgets/widget";
|
||||
import Block from "components/services/widgets/block";
|
||||
import Container from "components/services/widget/container";
|
||||
import Block from "components/services/widget/block";
|
||||
import { formatProxyUrl } from "utils/proxy/api-helpers";
|
||||
|
||||
export default function Component({ service }) {
|
||||
|
@ -13,21 +13,21 @@ export default function Component({ service }) {
|
|||
const { data: statusData, error: statusError } = useSWR(formatProxyUrl(config, "status"));
|
||||
|
||||
if (statusError) {
|
||||
return <Widget error={t("widget.api_error")} />;
|
||||
return <Container error={t("widget.api_error")} />;
|
||||
}
|
||||
|
||||
if (!statusData) {
|
||||
return (
|
||||
<Widget>
|
||||
<Container>
|
||||
<Block label={t("nzbget.rate")} />
|
||||
<Block label={t("nzbget.remaining")} />
|
||||
<Block label={t("nzbget.downloaded")} />
|
||||
</Widget>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Widget>
|
||||
<Container>
|
||||
<Block label={t("nzbget.rate")} value={t("common.bitrate", { value: statusData.DownloadRate })} />
|
||||
<Block
|
||||
label={t("nzbget.remaining")}
|
||||
|
@ -37,6 +37,6 @@ export default function Component({ service }) {
|
|||
label={t("nzbget.downloaded")}
|
||||
value={t("common.bytes", { value: statusData.DownloadedSizeMB * 1024 * 1024 })}
|
||||
/>
|
||||
</Widget>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue