starting of widget refactoring

This commit is contained in:
Ben Phelps 2022-09-25 19:43:47 +03:00
parent d6f6ea9dba
commit 562235f828
42 changed files with 337 additions and 301 deletions

View file

@ -4,14 +4,14 @@ import { useTranslation } from "next-i18next";
import Widget from "../widget";
import Block from "../block";
import { formatApiUrl } from "utils/api-helpers";
import { formatProxyUrl } from "utils/api-helpers";
export default function QBittorrent ({ service }) {
export default function QBittorrent({ service }) {
const { t } = useTranslation();
const config = service.widget;
const { data: torrentData, error: torrentError } = useSWR(formatApiUrl(config, "torrents/info"));
const { data: torrentData, error: torrentError } = useSWR(formatProxyUrl(config, "torrents/info"));
if (torrentError) {
return <Widget error={t("widget.api_error")} />;