diff --git a/src/components/PlayerProfileView/ProfileSummary.vue b/src/components/PlayerProfileView/ProfileSummary.vue index 28956d4..7070a33 100644 --- a/src/components/PlayerProfileView/ProfileSummary.vue +++ b/src/components/PlayerProfileView/ProfileSummary.vue @@ -81,7 +81,7 @@ :to="`/scenery?station=${d.stationName}`" > user icon - {{ d.stationName }} + {{ d.stationName }} ({{ getRegionNameById(d.region) }}) @@ -96,7 +96,7 @@ {{ d.timetable.category }} {{ d.trainNo }} • - {{ d.currentStationName }} + {{ d.currentStationName }} ({{ getRegionNameById(d.region) }}){{ d.stockString.split(';')[0] }} @@ -231,9 +231,8 @@ import { useI18n } from 'vue-i18n'; import { useApiStore } from '../../store/apiStore'; import StationStatusBadge from '../Global/StationStatusBadge.vue'; import axios from 'axios'; -import { Status } from '../../typings/common'; -import Loading from '../Global/Loading.vue'; import ProfilePlayerAvatar from './ProfilePlayerAvatar.vue'; +import { getRegionNameById } from '../../utils/regionUtils'; const { t } = useI18n(); diff --git a/src/utils/regionUtils.ts b/src/utils/regionUtils.ts new file mode 100644 index 0000000..2807b58 --- /dev/null +++ b/src/utils/regionUtils.ts @@ -0,0 +1,19 @@ +export enum ServerRegion { + 'eu' = 'PL1', + 'cae' = 'PL2', + 'usw' = 'DE', + 'us' = 'CZE', + 'ru' = 'ENG' +} + +export const regions: Record = { + eu: 'PL1', + cae: 'PL2', + usw: 'DE', + us: 'CZE', + ru: 'ENG' +}; + +export function getRegionNameById(id: string) { + return regions[id] ?? 'PL1'; +}