refactor: use suspense query instead of serverdata for app widget (#1143)

* refactor: use suspense query instead of serverdata for app widget

* chore: add missing translation for loading tooltip
This commit is contained in:
Meier Lukas
2024-09-17 19:30:14 +02:00
committed by GitHub
parent 003cc5160c
commit fc317840a7
11 changed files with 129 additions and 269 deletions

View File

@@ -1,4 +1,4 @@
import { IconApps } from "@tabler/icons-react";
import { IconApps, IconDeviceDesktopX } from "@tabler/icons-react";
import { createWidgetDefinition } from "../definition";
import { optionsBuilder } from "../options";
@@ -12,6 +12,11 @@ export const { definition, componentLoader, serverDataLoader } = createWidgetDef
showDescriptionTooltip: factory.switch({ defaultValue: false }),
pingEnabled: factory.switch({ defaultValue: false }),
})),
})
.withServerData(() => import("./serverData"))
.withDynamicImport(() => import("./component"));
errors: {
NOT_FOUND: {
icon: IconDeviceDesktopX,
message: (t) => t("widget.app.error.notFound.label"),
hideLogsLink: true,
},
},
}).withDynamicImport(() => import("./component"));