// app/clinics/page.js
import ClinicsPage from "@/components/clinics";
import Layout from "@/components/layout/StLayout";
import { fetchReq } from "@/lib/req";
import { getStateInfo } from "@/lib/getStateInfo";

export default async function Clinics() {
  const { matchedCity, matchedState } = getStateInfo();

  const clinics = await fetchReq(
    "https://back-dev.clinic-pro.ir/api/v1/clinics"
  );

  return (
    <Layout name="/clinics">
      <ClinicsPage
        clinics={clinics && clinics.data}
        matchedCity={matchedCity}
        matchedState={matchedState}
      />
    </Layout>
  );
}
