Revert "add more fed regions"

This reverts commit 0be7d9f75b.
This commit is contained in:
Pas 2025-09-09 12:02:59 -06:00
parent 7b7cdbb5c7
commit 3b2e1b062c
2 changed files with 14 additions and 32 deletions

View file

@ -7,15 +7,11 @@ export function RegionSelectorPart() {
const { region, setRegion } = useRegionStore();
const regionOptions = [
{ id: "dallas", name: "Dallas, TX" },
{ id: "portland", name: "Portland, OR" },
{ id: "new-york", name: "New York, NY" },
{ id: "paris", name: "Paris, France" },
{ id: "hong-kong", name: "Hong Kong" },
{ id: "kansas", name: "Kansas City, MO" },
{ id: "sydney", name: "Sydney, Australia" },
{ id: "singapore", name: "Singapore" },
{ id: "mumbai", name: "Mumbai, India" },
{ id: "east", name: "US East (Ohio)" },
{ id: "west", name: "US West (California)" },
{ id: "south", name: "South America (São Paulo)" },
{ id: "asia", name: "Asia Pacific (Sydney)" },
{ id: "europe", name: "Europe Central (London)" },
];
return (
@ -32,10 +28,10 @@ export function RegionSelectorPart() {
<Dropdown
options={regionOptions}
selectedItem={{
id: region || "new-york",
id: region || "east",
name:
regionOptions.find((r) => r.id === region)?.name ||
"Unknown (New York, NY)",
"Unknown (US East)",
}}
setSelectedItem={(item) => setRegion(item.id as Region, true)}
direction="up"

View file

@ -1,17 +1,7 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
export type Region =
| "dallas"
| "portland"
| "new-york"
| "paris"
| "hong-kong"
| "kansas"
| "sydney"
| "singapore"
| "mumbai"
| "unknown";
export type Region = "east" | "west" | "south" | "asia" | "europe" | "unknown";
interface RegionStore {
region: Region | null;
@ -36,22 +26,18 @@ export const useRegionStore = create<RegionStore>()(
}),
{
name: "__MW::region",
version: 5,
version: 6,
},
),
);
// Coordinates for each proxy server region
const regionCoordinates = [
{ region: "dallas" as Region, lat: 32.7767, lon: -96.797 }, // Dallas, TX, US
{ region: "portland" as Region, lat: 45.5152, lon: -122.6784 }, // Portland, OR, US
{ region: "new-york" as Region, lat: 40.7128, lon: -74.006 }, // New York, NY, US
{ region: "paris" as Region, lat: 48.8566, lon: 2.3522 }, // Paris, France
{ region: "hong-kong" as Region, lat: 22.3193, lon: 114.1694 }, // Hong Kong
{ region: "kansas" as Region, lat: 39.0997, lon: -94.5786 }, // Kansas City, MO, US
{ region: "sydney" as Region, lat: -33.8688, lon: 151.2093 }, // Sydney, Australia
{ region: "singapore" as Region, lat: 1.3521, lon: 103.8198 }, // Singapore
{ region: "mumbai" as Region, lat: 19.076, lon: 72.8777 }, // Mumbai, India
{ region: "east" as Region, lat: 40.4173, lon: -82.9071 }, // Ohio, US
{ region: "west" as Region, lat: 37.7749, lon: -122.4194 }, // California, US
{ region: "south" as Region, lat: -23.5505, lon: -46.6333 }, // São Paulo, BR
{ region: "asia" as Region, lat: -33.8688, lon: 151.2093 }, // Sydney, Australia
{ region: "europe" as Region, lat: 51.5074, lon: -0.1278 }, // London, UK
];
// Haversine formula