refactor: update appointment components to fetch and handle doctor data and disabled dates
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import doctors from "@/data/doctors.json";
|
||||
import { request } from "@/services/response";
|
||||
import Cookies from "js-cookie";
|
||||
import Container from "./Container";
|
||||
@@ -13,9 +12,7 @@ const defaultData = {
|
||||
basic_insurance: { value: "", isEdit: false },
|
||||
};
|
||||
|
||||
function AppointmentPage({ slug, matchedCity }) {
|
||||
const doctor = doctors.find((item) => item.id === +slug);
|
||||
|
||||
function AppointmentPage({ doctor, disabledDates, matchedCity }) {
|
||||
const [step, setStep] = useState(0);
|
||||
const [isForAnother, setIsForAnother] = useState(false);
|
||||
|
||||
@@ -78,6 +75,7 @@ function AppointmentPage({ slug, matchedCity }) {
|
||||
matchedCity={matchedCity}
|
||||
isForAnother={isForAnother}
|
||||
setIsForAnother={setIsForAnother}
|
||||
disabledDates={disabledDates}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user