Files
perfil/nuxt4/components/auth/StatusBadges.vue
josedario87 7de670d824 Add Authentik integration UI components
- Create useAuthentik composable to read headers
- Add UserAvatar component with avatar and user info
- Add StatusBadges for auth/connection status
- Add ActionButtons for logout and profile
- Add UserMetadata component with full user details
- Integrate all components in main page
- Use Nuxt UI components throughout
2025-10-12 22:53:44 -06:00

47 lines
1.1 KiB
Vue

<template>
<UCard class="w-full">
<div class="flex flex-wrap gap-2">
<!-- Estado de autenticación -->
<UBadge
:color="isAuthenticated ? 'success' : 'error'"
size="lg"
variant="subtle"
>
<template #leading>
<UIcon :name="isAuthenticated ? 'i-heroicons-check-circle' : 'i-heroicons-x-circle'" />
</template>
{{ isAuthenticated ? 'Autenticado' : 'No autenticado' }}
</UBadge>
<!-- Estado de conexión -->
<UBadge
color="success"
size="lg"
variant="subtle"
>
<template #leading>
<UIcon name="i-heroicons-signal" />
</template>
Conectado
</UBadge>
<!-- Número de grupos -->
<UBadge
v-if="user"
color="primary"
size="lg"
variant="subtle"
>
<template #leading>
<UIcon name="i-heroicons-user-group" />
</template>
{{ user.groups.length }} {{ user.groups.length === 1 ? 'Grupo' : 'Grupos' }}
</UBadge>
</div>
</UCard>
</template>
<script setup lang="ts">
const { user, isAuthenticated } = useAuthentik()
</script>