Initial commit: Vuelato - buscador de vuelos
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Some checks failed
ci / ci (22, ubuntu-latest) (push) Has been cancelled
Nuxt 4 + Supabase + Flightics API. Incluye búsqueda de vuelos, inspiraciones, watchlist, tracking de precios y mapa interactivo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
57
app/components/inspiration/BudgetExplorer.vue
Normal file
57
app/components/inspiration/BudgetExplorer.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<script setup lang="ts">
|
||||
import type { InspirationItem } from '~/server/utils/flightics'
|
||||
|
||||
defineProps<{
|
||||
items: InspirationItem[]
|
||||
from: string
|
||||
loading: boolean
|
||||
}>()
|
||||
|
||||
defineEmits<{ select: [iata: string] }>()
|
||||
|
||||
const budget = ref(100)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UCard>
|
||||
<template #header>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="font-semibold">Donde por {{ budget }}€?</h3>
|
||||
<UBadge
|
||||
:label="`${items.filter(i => i.minPrice <= budget).length} destinos`"
|
||||
color="primary"
|
||||
size="xs"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="mb-4">
|
||||
<URange v-model="budget" :min="15" :max="500" :step="5" />
|
||||
</div>
|
||||
|
||||
<div v-if="loading" class="grid grid-cols-2 md:grid-cols-3 gap-2">
|
||||
<USkeleton v-for="i in 6" :key="i" class="h-12" />
|
||||
</div>
|
||||
|
||||
<div v-else class="grid grid-cols-2 md:grid-cols-3 gap-2">
|
||||
<button
|
||||
v-for="item in items.filter(i => i.minPrice <= budget).slice(0, 12)"
|
||||
:key="item.to[0]"
|
||||
class="flex items-center justify-between px-3 py-2 rounded-lg border border-neutral-200 dark:border-neutral-700 hover:border-primary-400 transition-colors text-left text-sm"
|
||||
@click="$emit('select', item.to[0])"
|
||||
>
|
||||
<span>
|
||||
<span class="font-semibold">{{ from }} → {{ item.to[0] }}</span>
|
||||
<span v-if="item.minStops === 0" class="text-xs text-muted ml-1">directo</span>
|
||||
</span>
|
||||
<span class="font-bold text-primary-600 dark:text-primary-400">
|
||||
{{ item.minPrice.toFixed(0) }}€
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div v-if="items.filter(i => i.minPrice <= budget).length === 0 && !loading" class="text-center py-4 text-sm text-muted">
|
||||
Sube el presupuesto para ver destinos
|
||||
</div>
|
||||
</UCard>
|
||||
</template>
|
||||
37
app/components/inspiration/MultiCityCard.vue
Normal file
37
app/components/inspiration/MultiCityCard.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import type { MultiCityInspirationItem } from '~/server/utils/flightics'
|
||||
|
||||
const props = defineProps<{
|
||||
item: MultiCityInspirationItem
|
||||
currency?: string
|
||||
resolveCountry?: (iata: string) => string
|
||||
}>()
|
||||
|
||||
defineEmits<{ select: [item: MultiCityInspirationItem] }>()
|
||||
|
||||
const countrySummary = computed(() => {
|
||||
if (!props.resolveCountry) return ''
|
||||
const unique = [...new Set(props.item.stops.map(s => props.resolveCountry!(s)).filter(Boolean))]
|
||||
return unique.join(', ')
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UCard class="hover:ring-primary-500 transition-all cursor-pointer" @click="$emit('select', item)">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="font-semibold text-sm">
|
||||
{{ item.from }} → {{ item.stops.join(' → ') }}
|
||||
</p>
|
||||
<p class="text-xs text-muted mt-1">
|
||||
{{ item.stops.length }} parada{{ item.stops.length !== 1 ? 's' : '' }}
|
||||
<span v-if="countrySummary"> · {{ countrySummary }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<p class="text-lg font-bold text-primary-600 dark:text-primary-400">
|
||||
{{ item.minPrice.toFixed(0) }}<span class="text-xs">€</span>
|
||||
</p>
|
||||
</div>
|
||||
</UCard>
|
||||
</template>
|
||||
Reference in New Issue
Block a user