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:
@@ -1,7 +1,7 @@
|
||||
import type { ComponentType } from "react";
|
||||
import type { Loader } from "next/dynamic";
|
||||
import dynamic from "next/dynamic";
|
||||
import { Loader as UiLoader } from "@mantine/core";
|
||||
import { Center, Loader as UiLoader } from "@mantine/core";
|
||||
|
||||
import type { WidgetKind } from "@homarr/definitions";
|
||||
|
||||
@@ -65,7 +65,11 @@ export const loadWidgetDynamic = <TKind extends WidgetKind>(kind: TKind) => {
|
||||
const newlyLoadedComponent = dynamic<WidgetComponentProps<TKind>>(
|
||||
widgetImports[kind].componentLoader as Loader<WidgetComponentProps<TKind>>,
|
||||
{
|
||||
loading: () => <UiLoader />,
|
||||
loading: () => (
|
||||
<Center w="100%" h="100%">
|
||||
<UiLoader />
|
||||
</Center>
|
||||
),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user