diff --git a/src/widgets/components.js b/src/widgets/components.js
index 086da75a..3cef8aa4 100644
--- a/src/widgets/components.js
+++ b/src/widgets/components.js
@@ -3,6 +3,7 @@ import dynamic from "next/dynamic";
const components = {
overseerr: dynamic(() => import("./overseerr/component")),
radarr: dynamic(() => import("./radarr/component")),
+ sonarr: dynamic(() => import("./sonarr/component")),
};
export default components;
diff --git a/src/widgets/sonarr/component.jsx b/src/widgets/sonarr/component.jsx
new file mode 100644
index 00000000..f46c0f86
--- /dev/null
+++ b/src/widgets/sonarr/component.jsx
@@ -0,0 +1,38 @@
+import useSWR from "swr";
+import { useTranslation } from "next-i18next";
+
+import Widget from "components/services/widgets/widget";
+import Block from "components/services/widgets/block";
+import { formatProxyUrl } from "utils/api-helpers";
+
+export default function Component({ service }) {
+ const { t } = useTranslation();
+
+ const config = service.widget;
+
+ const { data: wantedData, error: wantedError } = useSWR(formatProxyUrl(config, "wanted/missing"));
+ const { data: queuedData, error: queuedError } = useSWR(formatProxyUrl(config, "queue"));
+ const { data: seriesData, error: seriesError } = useSWR(formatProxyUrl(config, "series"));
+
+ if (wantedError || queuedError || seriesError) {
+ return ;
+ }
+
+ if (!wantedData || !queuedData || !seriesData) {
+ return (
+
+
+
+
+
+ );
+ }
+
+ return (
+
+
+
+
+
+ );
+}
diff --git a/src/widgets/sonarr/widget.js b/src/widgets/sonarr/widget.js
new file mode 100644
index 00000000..c1718205
--- /dev/null
+++ b/src/widgets/sonarr/widget.js
@@ -0,0 +1,24 @@
+import genericProxyHandler from "utils/proxies/generic";
+import { asJson } from "utils/api-helpers";
+
+const widget = {
+ api: "{url}/api/v3/{endpoint}?apikey={key}",
+ proxyHandler: genericProxyHandler,
+
+ mappings: {
+ "series": {
+ endpoint: "series",
+ map: (data) => ({
+ total: asJson(data).length,
+ }),
+ },
+ "queue": {
+ endpoint: "queue",
+ },
+ "wanted/missing": {
+ endpoint: "wanted/missing",
+ },
+ },
+};
+
+export default widget;
diff --git a/src/widgets/widgets.js b/src/widgets/widgets.js
index db4f22ef..96eb2929 100644
--- a/src/widgets/widgets.js
+++ b/src/widgets/widgets.js
@@ -1,9 +1,11 @@
import overseerr from "./overseerr/widget";
import radarr from "./radarr/widget";
+import sonarr from "./sonarr/widget"
const widgets = {
overseerr,
radarr,
+ sonarr,
};
export default widgets;