diff --git a/app/component/modalSearchCity/index.js b/app/component/modalSearchCity/index.js index caa0d0f..490c1ed 100644 --- a/app/component/modalSearchCity/index.js +++ b/app/component/modalSearchCity/index.js @@ -11,7 +11,7 @@ import Content from "./Content"; function ModalSearchCity({ children, selected, setSelected, open, setOpen }) { const provinceSelected = selected.province; - const hostName = window.location.host; + const [hostName, setHostName] = useState(""); const isProvinceInclude = citiesData.find( (city) => city.domain !== "nobat724.com" && hostName.includes(city.domain) ); @@ -36,6 +36,8 @@ function ModalSearchCity({ children, selected, setSelected, open, setOpen }) { province_id: city.province_id, })); + setHostName(window.location.hostname); + setStates(formattedStates); setCities(formattedCities); }, []); diff --git a/components/doctors/index.js b/components/doctors/index.js index 53bb233..82469fc 100644 --- a/components/doctors/index.js +++ b/components/doctors/index.js @@ -6,7 +6,6 @@ import SortList from "./sortlist"; import ListDoctors from "./listDoctors"; import LocationD from "../icons/LocationD"; import { useSearchParams } from "next/navigation"; -import { Suspense } from "react"; function DoctorsPage() { const [loading, setLoading] = useState(true);