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:
46
app/components/auth/UserMenu.vue
Normal file
46
app/components/auth/UserMenu.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<script setup lang="ts">
|
||||
const { user, logout } = useAuth()
|
||||
|
||||
const items = computed(() => [
|
||||
[{
|
||||
label: user.value?.email ?? '',
|
||||
disabled: true
|
||||
}],
|
||||
[{
|
||||
label: 'Watchlist',
|
||||
icon: 'i-lucide-heart',
|
||||
to: '/watchlist'
|
||||
},
|
||||
{
|
||||
label: 'Preferencias',
|
||||
icon: 'i-lucide-settings',
|
||||
to: '/settings'
|
||||
}],
|
||||
[{
|
||||
label: 'Cerrar sesion',
|
||||
icon: 'i-lucide-log-out',
|
||||
click: logout
|
||||
}]
|
||||
])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="user">
|
||||
<UDropdownMenu :items="items">
|
||||
<UButton
|
||||
icon="i-lucide-user"
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
:label="user.email?.split('@')[0]"
|
||||
/>
|
||||
</UDropdownMenu>
|
||||
</div>
|
||||
<UButton
|
||||
v-else
|
||||
to="/auth"
|
||||
label="Entrar"
|
||||
icon="i-lucide-log-in"
|
||||
variant="ghost"
|
||||
color="neutral"
|
||||
/>
|
||||
</template>
|
||||
Reference in New Issue
Block a user