diff --git a/app/component/ItemDoctor.js b/app/component/ItemDoctor.js
index 81c3434..13be1fb 100644
--- a/app/component/ItemDoctor.js
+++ b/app/component/ItemDoctor.js
@@ -11,10 +11,22 @@ import CustomLoading from "./loading/Custom";
import TextLoading from "./loading/Text";
import CircularLoading from "./loading/Circular";
import moment from "moment-jalaali";
+import { useState } from "react";
moment.loadPersian({ dialect: "persian-modern" });
-function ItemDoctor({ doctor }) {
+function ItemDoctor({ doctor, doctors, setDoctors }) {
+ const [loading, setLoading] = useState(false);
+ const handleLoading = () => {
+ setDoctors((prevDoctors) =>
+ prevDoctors.map((item) =>
+ item.id === doctor.id
+ ? { ...item, loading: true }
+ : { ...item, loading: false }
+ )
+ );
+ };
+
return (
@@ -79,7 +79,7 @@ function Content({
onClick={handleClick}
variant="contained"
color="primary"
- disabled={!filter.city || !filter.state}
+ disabled={!filter?.city || !filter?.state}
>
تایید و ادامه
diff --git a/app/component/openLocation/Content.js b/app/component/openLocation/Content.js
index 14b9370..67494ac 100644
--- a/app/component/openLocation/Content.js
+++ b/app/component/openLocation/Content.js
@@ -1,22 +1,44 @@
import CloseModalD from "@/components/icons/CloseModalD";
import Image from "next/image";
-const maps = [
- { src: "/assets/images/snapp.png", name: "snapp" },
- { src: "/assets/images/tapsi.png", name: "tapsi" },
- { src: "/assets/images/maps.png", name: "maps" },
- { src: "/assets/images/balad.png", name: "balad" },
- { src: "/assets/images/waze.png", name: "waze" },
-];
+function Content({ data, onClose }) {
+ const { latitude, longitude } = data && data.map;
+
+ const maps = [
+ {
+ src: "/assets/images/snapp.png",
+ name: "snapp",
+ url: `https://snapp.ir/route?lat=${latitude}&lng=${longitude}`,
+ },
+ {
+ src: "/assets/images/tapsi.png",
+ name: "tapsi",
+ url: `https://tapsi.ir/route?lat=${latitude}&lng=${longitude}`,
+ },
+ {
+ src: "/assets/images/maps.png",
+ name: "maps",
+ url: `https://www.google.com/maps/dir/?api=1&destination=${latitude},${longitude}`,
+ },
+ {
+ src: "/assets/images/balad.png",
+ name: "balad",
+ url: `https://balad.ir/map?lat=${latitude}&lng=${longitude}`,
+ },
+ {
+ src: "/assets/images/waze.png",
+ name: "waze",
+ url: `https://waze.com/ul?ll=${latitude},${longitude}&navigate=yes`,
+ },
+ ];
-function Content({ handleClose }) {
return (
<>
باز شدن با
-
@@ -27,20 +49,22 @@ function Content({ handleClose }) {
key={idx}
className="flex items-center flex-col justify-center gap-1"
>
-
-
- {item.name}
-
+
+
+
+ {item.name}
+
+
))}
diff --git a/app/component/openLocation/index.js b/app/component/openLocation/index.js
index e386806..90fe8c8 100644
--- a/app/component/openLocation/index.js
+++ b/app/component/openLocation/index.js
@@ -4,7 +4,7 @@ import { Drawer, Modal } from "@mui/material";
import { styleDefault } from "@/mui";
import Content from "./Content";
-function ModalOpenLocation({ open, setOpen, handleClose, children }) {
+function ModalOpenLocation({ open, data, setOpen, handleClose, children }) {
const toggleDrawer = (newOpen) => () => {
setOpen(newOpen);
};
@@ -19,7 +19,7 @@ function ModalOpenLocation({ open, setOpen, handleClose, children }) {
style={styleDefault}
className="!pt-[12px] !pb-[28px] !px-[24px] !bg-[#FAFAFA] !rounded-[8px] !overflow-hidden"
>
-
+
-
+
>
diff --git a/components/clinics/head/SearchBar.js b/components/clinics/head/SearchBar.js
index 8ae2b4c..93d513a 100644
--- a/components/clinics/head/SearchBar.js
+++ b/components/clinics/head/SearchBar.js
@@ -1,9 +1,9 @@
import { Button, ButtonGroup, TextField } from "@mui/material";
import SearchD from "@/components/icons/SearchD";
-import ModalSearchCity from "@/app/component/modalSearchCity";
import { useState } from "react";
import ButtonFilter from "@/app/component/modalSearchCity/ButtonFilter";
import AutoCompleteSearch from "@/components/searchHead/smSearch/AutoCompleteSearch";
+import ModalSearchCity from "@/components/home/search/modal";
function SearchBar({
selected,
@@ -28,7 +28,7 @@ function SearchBar({
setOpen={setOpen}
selected={selected}
setSelected={setSelected}
- handleSearch={handleSearch}
+ // handleSearch={handleSearch}
>
diff --git a/components/clinics/index.js b/components/clinics/index.js
index 04e9e8e..7342e2d 100644
--- a/components/clinics/index.js
+++ b/components/clinics/index.js
@@ -32,8 +32,8 @@ function ClinicsPage({ clinics, matchedCity, matchedState }) {
>
diff --git a/components/doctor/appointmentList/ItemAppointment.js b/components/doctor/appointmentList/ItemAppointment.js
index b97d1eb..f760f79 100644
--- a/components/doctor/appointmentList/ItemAppointment.js
+++ b/components/doctor/appointmentList/ItemAppointment.js
@@ -5,7 +5,9 @@ import GreenCalendarTurn from "@/components/icons/GreenCalendarTurn";
import { Button } from "@mui/material";
import Image from "next/image";
import Link from "next/link";
-import React from "react";
+import moment from "moment-jalaali";
+
+moment.loadPersian({ dialect: "persian-modern" });
function ItemAppointment({ turn, loading }) {
return (
@@ -17,7 +19,7 @@ function ItemAppointment({ turn, loading }) {
-
+
@@ -26,9 +28,9 @@ function ItemAppointment({ turn, loading }) {
تخصص:
- {turn?.expertise?.map(
+ {turn?.specialties?.map(
(item, idx) =>
- `${item.name} ${turn.expertise.length === idx + 1 ? "" : "|"} `
+ `${item.name} ${turn.specialties.length === idx + 1 ? "" : "|"} `
)}
@@ -39,7 +41,11 @@ function ItemAppointment({ turn, loading }) {
- اولین نوبت آزاد: {turn.first_free_turn || "یکشنبه 24 اردیبهشت"}
+ {Number(turn?.active)
+ ? `اولین نوبت آزاد: ${moment(turn?.free_turn * 1000).format(
+ "dddd jD jMMMM [ساعت] HH:mm"
+ )}`
+ : "نوبت ندارد"}
diff --git a/components/doctor/appointmentList/index.js b/components/doctor/appointmentList/index.js
index 1ae2ec4..8f4a19f 100644
--- a/components/doctor/appointmentList/index.js
+++ b/components/doctor/appointmentList/index.js
@@ -22,9 +22,9 @@ function AppointmentList({ doctors, loading }) {
border-solid bottom-0 right-0 w-full p-4 flex items-center justify-between"
>
- اولین نوبت آزاد: {doctors[0]?.free_turn}
+ اولین نوبت آزاد: {doctors && doctors[0]?.free_turn}
-
+
diff --git a/components/doctor/detailDoctor/cards/comments/chart/index.js b/components/doctor/detailDoctor/cards/comments/chart/index.js
index 71ca835..e9b0b74 100644
--- a/components/doctor/detailDoctor/cards/comments/chart/index.js
+++ b/components/doctor/detailDoctor/cards/comments/chart/index.js
@@ -6,7 +6,10 @@ import ProgressDetail from "@/app/component/ProfressDetail";
import TextLoading from "@/app/component/loading/Text";
import CustomLoading from "@/app/component/loading/Custom";
-function Chart({ doctor }) {
+function Chart({ comments, doctor }) {
+ console.log(doctor);
+ console.log(comments);
+
return (
- امتیاز کلی کاربران: {doctor?.overall_score} از 5
+ امتیاز کلی کاربران: {doctor?.point} از 5
- (از مجموع {doctor?.comments?.length} نظر)
+ (از مجموع {comments?.length} نظر)
@@ -28,7 +31,7 @@ function Chart({ doctor }) {
-