import DoctorsPage from "@/components/doctors"; import Layout from "@/components/layout/StLayout"; import { getStateInfo } from "@/lib/getStateInfo"; import axios from "axios"; async function Doctors({ searchParams }) { const { matchedCity, matchedState } = getStateInfo(); const API_URL = process.env.NEXT_PUBLIC_API_URL; let doctors = null; try { const params = {}; if (matchedCity) params.city = matchedCity?.id || null; if (matchedState) params.state = matchedState?.id || null; const response = await axios.get(`${API_URL}/api/v1/doctors`, { params, }); doctors = response.data.data; } catch (error) {} return ( ); } export default Doctors;