Add detailed Error component for service widgets

This commit is contained in:
Michael Shamoon
2022-10-22 23:00:51 -07:00
parent 7b7740563e
commit 21017e4716
37 changed files with 113 additions and 113 deletions

View File

@@ -12,7 +12,8 @@ export default function Component({ service }) {
const { data: statsData, error: statsError } = useWidgetAPI(widget, "stat/sites");
if (statsError || statsData?.error) {
return <Container error={t("widget.api_error")} />;
const finalError = statsError ?? statsData.error;
return <Container error={finalError} />;
}
const defaultSite = statsData?.data?.find(s => s.name === "default");