Files
dancefinder-app/components/pages/events/event-distance.vue
T

38 lines
937 B
Vue
Raw Normal View History

2024-02-05 16:48:02 +01:00
<template>
2024-02-06 07:43:46 +01:00
<v-row dense>
<v-col cols="12" sm="12" md="6">
2024-02-05 16:48:02 +01:00
<v-icon class="me-1">
mdi-home
</v-icon>
<span><strong>{{ distance.origin }}</strong></span>
</v-col>
2024-02-06 07:43:46 +01:00
<v-col cols="12" sm="12" md="6">
2024-02-05 16:48:02 +01:00
<v-icon class="me-1">
mdi-car
</v-icon>
<span>{{ numericDistance }} km</span>
<v-icon class="ms-2 me-1">
mdi-clock-outline
</v-icon>
<span>{{ distance.duration }}</span>
</v-col>
</v-row>
</template>
<script setup lang='ts'>
import { computed, type PropType } from 'vue'
import type { DanceHallDistance } from '~/graphql/generated/operations'
2024-02-05 16:48:02 +01:00
const props = defineProps({
distance: {
type: Object as PropType<DanceHallDistance>,
required: true,
},
})
const numericDistance = computed(() =>
Number(props.distance.distance / 1000).toLocaleString('sv-SE', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}))
</script>