diff --git a/src/components/widgets/unifi_console/unifi_console.jsx b/src/components/widgets/unifi_console/unifi_console.jsx
index 13c90bd42..1896771f8 100644
--- a/src/components/widgets/unifi_console/unifi_console.jsx
+++ b/src/components/widgets/unifi_console/unifi_console.jsx
@@ -2,6 +2,9 @@ import { BiError, BiWifi, BiCheckCircle, BiXCircle, BiNetworkChart } from "react
import { MdSettingsEthernet } from "react-icons/md";
import { useTranslation } from "next-i18next";
import { SiUbiquiti } from "react-icons/si";
+import classNames from "classnames";
+
+import Error from "../error";
import useWidgetAPI from "utils/proxy/use-widget-api";
@@ -13,25 +16,17 @@ export default function Widget({ options }) {
const { data: statsData, error: statsError } = useWidgetAPI(options, "stat/sites", { index: options.index });
if (statsError) {
- return (
-
-
-
-
-
- {t("widget.api_error")}
-
-
-
-
- );
+ return
}
const defaultSite = options.site ? statsData?.data.find(s => s.desc === options.site) : statsData?.data?.find(s => s.name === "default");
if (!defaultSite) {
return (
-
+
@@ -57,7 +52,10 @@ export default function Widget({ options }) {
const dataEmpty = !(wan.show || lan.show || wlan.show || uptime);
return (
-
+
diff --git a/src/components/widgets/weather/weather.jsx b/src/components/widgets/weather/weather.jsx
index 20bf3dec2..518014552 100644
--- a/src/components/widgets/weather/weather.jsx
+++ b/src/components/widgets/weather/weather.jsx
@@ -1,9 +1,11 @@
import useSWR from "swr";
import { useState } from "react";
-import { BiError } from "react-icons/bi";
import { WiCloudDown } from "react-icons/wi";
import { MdLocationDisabled, MdLocationSearching } from "react-icons/md";
import { useTranslation } from "next-i18next";
+import classNames from "classnames";
+
+import Error from "../error";
import Icon from "./icon";
@@ -15,24 +17,15 @@ function Widget({ options }) {
);
if (error || data?.error) {
- return (
-
-
-
-
-
- {t("widget.api_error")}
- -
-
-
-
-
- );
+ return
}
if (!data) {
return (
-
+
@@ -49,7 +42,10 @@ function Widget({ options }) {
const unit = options.units === "metric" ? "celsius" : "fahrenheit";
return (
-
+
@@ -106,7 +102,10 @@ export default function WeatherApi({ options }) {