Improve nearest hubs layout and show distance
All checks were successful
Build Docker Image / build (push) Successful in 4m49s

This commit is contained in:
Ruslan Bakiev
2026-02-05 19:24:03 +07:00
parent 0f0b1db394
commit 71a27a4ab9
3 changed files with 58 additions and 12 deletions

View File

@@ -23,8 +23,8 @@
<Text tone="muted" size="sm">
{{ countryFlag }} {{ hub.country || t('catalogMap.labels.country_unknown') }}
</Text>
<span v-if="hub.distance" class="badge badge-neutral badge-dash text-xs">
{{ hub.distance }}
<span v-if="distanceLabel" class="badge badge-neutral badge-dash text-xs">
{{ distanceLabel }}
</span>
</div>
<!-- Transport icons bottom -->
@@ -48,6 +48,7 @@ interface Hub {
country?: string | null
countryCode?: string | null
distance?: string
distanceKm?: number | null
transportTypes?: (string | null)[] | null
}
@@ -82,4 +83,9 @@ const countryFlag = computed(() => {
})
const hasTransport = (type: string) => props.hub.transportTypes?.some(t => t === type)
const distanceLabel = computed(() => {
if (props.hub.distance) return props.hub.distance
if (props.hub.distanceKm != null) return `${Math.round(props.hub.distanceKm)} km`
return ''
})
</script>