export async function getUserCountryCode(): Promise<string | null> {
  try {
    const response = await fetch("http://ip-api.com/json");
    if (!response.ok) {
      console.warn("Failed to fetch country info:", response.status);
      return null;
    }
    const data = await response.json();
    return data?.countryCode || null;
  } catch (error) {
    console.log(error);
    return null;
  }
}
