29 lines
711 B
JavaScript
29 lines
711 B
JavaScript
import ClinicPage from "@/components/clinic";
|
|
import Layout from "@/components/layout/StLayout";
|
|
import { fetchReq } from "@/lib/req";
|
|
|
|
async function Clinic({ params: { slug } }) {
|
|
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
|
|
|
const reqClinics = await fetchReq(
|
|
`${API_URL}/api/v1/clinic/${slug}`
|
|
);
|
|
const limit=50
|
|
const reqDoctors = await fetchReq(
|
|
`${API_URL}/api/v1/clinic/doctor-list/${slug}?page=1&limit=${limit}`
|
|
);
|
|
|
|
|
|
const clinic = reqClinics;
|
|
const doctors = reqDoctors?.data || [];
|
|
const pagedoctors=reqDoctors?.page
|
|
|
|
return (
|
|
<Layout>
|
|
<ClinicPage data={clinic} doctors={doctors} slug={slug} pages={pagedoctors} />
|
|
</Layout>
|
|
);
|
|
}
|
|
|
|
export default Clinic;
|