import AppointmentPage from "@/components/appointment"; import { getStateInfo } from "@/lib/getStateInfo"; import axios from "axios"; async function Appointment({ params }) { const { doctorId } = await params; const { matchedCity } = await getStateInfo(); const API_URL = process.env.NEXT_PUBLIC_API_URL; let doctor = null; let disabledDates = []; try { const doctorRes = await axios.get(`${API_URL}/api/v1/doctor/${doctorId}`); doctor = doctorRes.data; if (doctor && doctor.id) { const disabledDatesRes = await axios.get( `${API_URL}/api/v1/appointment/not-available/${doctor.id}`, { headers: { "Content-Type": "application/json" } } ); disabledDates = disabledDatesRes.data?.data || []; } } catch (error) {} return ( ); } export default Appointment;