import AppointmentPage from "@/components/appointment";
import { getStateInfo } from "@/lib/getStateInfo";
import { axiosInstance } from "@/lib/req";

export const metadata = {
    robots: { index: false, follow: false },
};

async function Appointment({ params }) {
  const { doctorId } = await params;
  const { matchedCity } = await getStateInfo();
  const API_URL = process.env.NEXT_PUBLIC_API_URL;

  let doctor = null;

  try {
    const doctorRes = await axiosInstance.get(`${API_URL}/api/v1/doctor/${doctorId}`);
    doctor = doctorRes.data?.data?.data;
  } catch (error) {}

  return (
    <AppointmentPage
      doctor={doctor}
      disabledDates={[]}
      matchedCity={matchedCity}
    />
  );
}

export default Appointment;
