diff --git a/src/app/projects/map/page.js b/src/app/projects/map/page.js
index 7875050..70d5543 100644
--- a/src/app/projects/map/page.js
+++ b/src/app/projects/map/page.js
@@ -9,6 +9,20 @@ import Button from "@/components/ui/Button";
import { mapLayers } from "@/components/ui/mapLayers";
import { formatProjectStatus } from "@/lib/utils";
+// Loading component that can access translations
+function MapLoadingComponent({ t }) {
+ return (
+
+ {t ? t('map.loadingMap') : 'Loading map...'}
+
+ );
+}
+
+// Dynamically import the map component to avoid SSR issues
+const DynamicMap = dynamic(() => import("@/components/ui/LeafletMap"), {
+ ssr: false,
+});
+
function ProjectsMapPageContent() {
const searchParams = useSearchParams();
const router = useRouter();
@@ -29,15 +43,16 @@ function ProjectsMapPageContent() {
const [showLayerPanel, setShowLayerPanel] = useState(true);
const [currentTool, setCurrentTool] = useState("move"); // Current map tool
- // Dynamically import the map component to avoid SSR issues
- const DynamicMap = dynamic(() => import("@/components/ui/LeafletMap"), {
- ssr: false,
- loading: () => (
-
- {t('map.loadingMap')}
-
- ),
- });
+ // Wrapper component for the map with proper loading state
+ const MapWrapper = React.useMemo(() => {
+ return function MapWrapperComponent(props) {
+ return (
+ }>
+
+
+ );
+ };
+ }, [t]);
// Status configuration with colors and labels
const statusConfig = {
@@ -920,7 +935,7 @@ function ProjectsMapPageContent() {
) : (
-