Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions static/app/utils/regions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,29 @@ import type {Region} from 'sentry/types/system';

const RegionDisplayName: Record<string, string> = {
US: t('United States of America (US)'),
US2: t('United States of America (US2)'),
DE: t('European Union (EU)'),
};

enum RegionFlagIndicator {
US = '🇺🇸',
DE = '🇪🇺',
}
const RegionFlagIndicator: Record<string, string> = {
US: '🇺🇸',
US2: '🇺🇸',
DE: '🇪🇺',
};

interface RegionData {
displayName: string;
name: string;
url: string;
flag?: RegionFlagIndicator;
flag?: string;
}

function getRegionDisplayName(region: Region): string {
return RegionDisplayName[region.name.toUpperCase()] ?? region.name;
}

function getRegionFlagIndicator(region: Region): RegionFlagIndicator | undefined {
function getRegionFlagIndicator(region: Region): string | undefined {
const regionName = region.name.toUpperCase();
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
return RegionFlagIndicator[regionName];
}

Expand Down
Loading