21 lines
522 B
TypeScript
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} />;
|
|
}
|