remove context && change design & modals & function && add folder lib

This commit is contained in:
Ehsan
2025-05-10 17:05:06 +03:30
parent a89fc4a3f9
commit f2e880c721
10 changed files with 160 additions and 160 deletions
+16
View File
@@ -0,0 +1,16 @@
import { headers } from "next/headers";
// Data
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 matchedCity = citiesData.find((city) => city.domain.includes(subdomain));
const matchedState = matchedCity && statesData.find(state => state.id === matchedCity.province_id)
return { matchedCity, matchedState };
}