diff --git a/components/doctor/detailDoctor/cards/locations/Item.js b/components/doctor/detailDoctor/cards/locations/Item.js
index 0da8b27..d2027a5 100644
--- a/components/doctor/detailDoctor/cards/locations/Item.js
+++ b/components/doctor/detailDoctor/cards/locations/Item.js
@@ -1,12 +1,16 @@
"use client";
import { useState } from "react";
+import dynamic from "next/dynamic";
import { Button } from "@mui/material";
import ArrowBottomGrayD from "@/components/icons/ArrowBottomGrayD";
import ModalOpenLocation from "@/app/component/openLocation";
import RoutingWhiteC from "@/components/icons/RoutingWhiteC";
import RoutingC from "@/components/icons/RoutingC";
+// Leaflet به window نیاز دارد → فقط کلاینت
+const MapView = dynamic(() => import("./MapView"), { ssr: false });
+
function Item({ data }) {
const [isOpen, setIsOpen] = useState(false);
@@ -64,13 +68,10 @@ function Item({ data }) {
{isOpen && data?.map?.latitude && data?.map?.longitude && (
-
+
+
+
+
+ );
+}
diff --git a/package-lock.json b/package-lock.json
index 00b7e28..9a1d842 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -33,6 +33,7 @@
"jalali-moment": "^3.3.11",
"js-cookie": "^3.0.5",
"jspdf": "^3.0.4",
+ "leaflet": "^1.9.4",
"moment-jalaali": "^0.10.4",
"next": "^16.2.10",
"next-themes": "^0.4.6",
@@ -45,6 +46,7 @@
"react-easy-crop": "^5.5.6",
"react-google-map-picker": "^1.2.3",
"react-images-uploading": "^3.1.7",
+ "react-leaflet": "^5.0.0",
"react-toastify": "^11.0.5",
"sharp": "^0.34.5",
"styled-components": "^6.1.19",
@@ -1745,6 +1747,17 @@
"url": "https://opencollective.com/popperjs"
}
},
+ "node_modules/@react-leaflet/core": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@react-leaflet/core/-/core-3.0.0.tgz",
+ "integrity": "sha512-3EWmekh4Nz+pGcr+xjf0KNyYfC3U2JjnkWsh0zcqaexYqmmB5ZhH37kz41JXGmKzpaMZCnPofBBm64i+YrEvGQ==",
+ "license": "Hippocratic-2.1",
+ "peerDependencies": {
+ "leaflet": "^1.9.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
+ }
+ },
"node_modules/@react-spring/animated": {
"version": "9.7.5",
"license": "MIT",
@@ -6359,6 +6372,12 @@
"node": ">=0.10"
}
},
+ "node_modules/leaflet": {
+ "version": "1.9.4",
+ "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
+ "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",
+ "license": "BSD-2-Clause"
+ },
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -9489,6 +9508,20 @@
"version": "19.2.1",
"license": "MIT"
},
+ "node_modules/react-leaflet": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-5.0.0.tgz",
+ "integrity": "sha512-CWbTpr5vcHw5bt9i4zSlPEVQdTVcML390TjeDG0cK59z1ylexpqC6M1PJFjV8jD7CF+ACBFsLIDs6DRMoLEofw==",
+ "license": "Hippocratic-2.1",
+ "dependencies": {
+ "@react-leaflet/core": "^3.0.0"
+ },
+ "peerDependencies": {
+ "leaflet": "^1.9.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
+ }
+ },
"node_modules/react-refresh": {
"version": "0.17.0",
"dev": true,
diff --git a/package.json b/package.json
index 577bc7d..37b2b5e 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"jalali-moment": "^3.3.11",
"js-cookie": "^3.0.5",
"jspdf": "^3.0.4",
+ "leaflet": "^1.9.4",
"moment-jalaali": "^0.10.4",
"next": "^16.2.10",
"next-themes": "^0.4.6",
@@ -52,6 +53,7 @@
"react-easy-crop": "^5.5.6",
"react-google-map-picker": "^1.2.3",
"react-images-uploading": "^3.1.7",
+ "react-leaflet": "^5.0.0",
"react-toastify": "^11.0.5",
"sharp": "^0.34.5",
"styled-components": "^6.1.19",