Added Notifications
This commit is contained in:
@@ -35,18 +35,13 @@
|
||||
<div class="stat">
|
||||
<template v-if="totalDistanceKm">
|
||||
<div class="stat-primary">
|
||||
<span class="stat-num">{{ totalDistanceKm.toLocaleString() }}</span>
|
||||
<span class="unit">km</span>
|
||||
<span class="stat-num"><Distance includeSpace :value="totalDistanceKm" /></span>
|
||||
</div>
|
||||
<div class="stat-sub">{{ totalDistanceMi.toLocaleString() }} miles</div>
|
||||
</template>
|
||||
<template v-if="upcomingDistanceKm">
|
||||
<div :class="totalDistanceKm ? 'stat-upcoming' : 'stat-primary'">
|
||||
<span :class="totalDistanceKm ? 'stat-upcoming-num' : 'stat-num'">{{ upcomingDistanceKm.toLocaleString() }}</span>
|
||||
<span :class="totalDistanceKm ? 'stat-upcoming-lbl' : 'unit'">{{ totalDistanceKm ? 'km upcoming' : 'km' }}</span>
|
||||
<span v-if="!totalDistanceKm" class="upcoming-badge">upcoming</span>
|
||||
<span :class="totalDistanceKm ? 'stat-upcoming-num' : 'stat-num'"><Distance includeSpace :value="upcomingDistanceKm"/></span>
|
||||
</div>
|
||||
<div v-if="!totalDistanceKm" class="stat-sub">{{ upcomingDistanceMi.toLocaleString() }} miles</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -105,6 +100,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import type { Flight } from '@/Types/types'
|
||||
import Distance from "@/Components/Distance.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
flights: Flight[]
|
||||
@@ -117,10 +113,6 @@ const totalDistanceKm = computed(() =>
|
||||
Math.round(props.flights.reduce((sum, f) => sum + (f.distance ?? 0), 0))
|
||||
)
|
||||
|
||||
const totalDistanceMi = computed(() =>
|
||||
Math.round(totalDistanceKm.value * 0.621371)
|
||||
)
|
||||
|
||||
const uniqueRoutes = computed(() => {
|
||||
const keys = new Set(props.flights.map(f =>
|
||||
[f.departure_airport.id, f.arrival_airport.id].sort().join('-')
|
||||
@@ -164,10 +156,6 @@ const upcomingDistanceKm = computed(() =>
|
||||
Math.round(props.upcomingFlights.reduce((sum, f) => sum + (f.distance ?? 0), 0))
|
||||
)
|
||||
|
||||
const upcomingDistanceMi = computed(() =>
|
||||
Math.round(upcomingDistanceKm.value * 0.621371)
|
||||
)
|
||||
|
||||
const uniqueUpcomingRoutes = computed(() => {
|
||||
const keys = new Set(props.upcomingFlights.map(f =>
|
||||
[f.departure_airport.id, f.arrival_airport.id].sort().join('-')
|
||||
|
||||
Reference in New Issue
Block a user