Files
bookmanager/src/components/map-loader.tsx
T
2026-10-22 21:00:25 +02:00

21 lines
522 B
TypeScript

"use client";
import dynamic from "next/dynamic";
import { useT } from "@/i18n/client";
import type { MapViewProps } from "./map-view";
// Leaflet använder window och får därför inte renderas på servern.
const MapView = dynamic(() => import("./map-view"), {
ssr: false,
loading: () => <MapLoading />,
});
function MapLoading() {
const t = useT();
return <div className="text-secondary p-4">{t("common.loading")}</div>;
}
export function MapLoader(props: MapViewProps) {
return <MapView {...props} />;
}