change format all file

This commit is contained in:
Ehsan
2025-05-18 01:18:35 +03:30
parent 4a57468e26
commit 254d5d4ebd
84 changed files with 721 additions and 651 deletions
+10 -6
View File
@@ -5,12 +5,16 @@ import citiesData from "@/data/city.json";
import statesData from "@/data/state.json";
export function getStateInfo() {
const headersList = headers();
const host = headersList.get("host") || "";
const subdomain = host.split(".")[0];
const headersList = headers();
const host = headersList.get("host") || "";
const subdomain = host.split(".")[0];
const matchedCity = citiesData.find((city) => city.domain.includes(subdomain));
const matchedState = matchedCity && statesData.find(state => state.id === matchedCity.province_id)
const matchedCity = citiesData.find((city) =>
city.domain.includes(subdomain),
);
const matchedState =
matchedCity &&
statesData.find((state) => state.id === matchedCity.province_id);
return { matchedCity, matchedState };
return { matchedCity, matchedState };
}