change name office-info && change name img uploaded && change theme selector && set default tab in appo page && clean code
This commit is contained in:
@@ -3,16 +3,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import Hours from "./hours";
|
||||
import Tabs from "../../Tabs";
|
||||
import { Button } from "@mui/material";
|
||||
import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
||||
import { request } from "@/services/response";
|
||||
import { useParams, useSearchParams } from "next/navigation";
|
||||
import { useParams } from "next/navigation";
|
||||
import SendAppo from "./SendAppo";
|
||||
|
||||
const listTab = ["صبح", "بعد از ظهر"];
|
||||
const nameHours = ["hours_morning", "hours_afternoon"];
|
||||
|
||||
function DateTime({ date, doctor, setStep, setIsError, locateVisit }) {
|
||||
function DateTime({ date, doctor }) {
|
||||
const params = useParams();
|
||||
const doctorId = params.doctorId;
|
||||
const [value, setValue] = useState(0);
|
||||
@@ -32,6 +30,9 @@ function DateTime({ date, doctor, setStep, setIsError, locateVisit }) {
|
||||
.getAppointment(doctorId, date)
|
||||
.then((res) => {
|
||||
setAppo(res);
|
||||
if (res.morning?.length && res.evening?.length) setValue(0);
|
||||
else if (res.morning?.length && value !== 0) setValue(0);
|
||||
else if (res.evening?.length && value !== 1) setValue(1);
|
||||
})
|
||||
.catch((err) => {
|
||||
setAppo("در حال حاضر، نوبتی برای ساعتهای صبح موجود نمیباشد.");
|
||||
|
||||
Reference in New Issue
Block a user