--- import AppLayout from '@/layouts/AppLayout.astro'; import PerfilForm from '@/components/profile/PerfilForm.tsx'; import Avatar from '@/components/profile/Avatar.tsx'; import { avatarInfo } from '@/lib/avatar'; const user = Astro.locals.user!; const profile = Astro.locals.profile!; const googleAvatarUrl = (user.user_metadata as Record | undefined)?.avatar_url as string | undefined || (user.user_metadata as Record | undefined)?.picture as string | undefined || null; const { data: maestrosData } = await Astro.locals.supabase .from('maestros') .select('id, nombre') .eq('activo', true) .eq('es_tutor', true) .order('nombre'); const maestros = (maestrosData ?? []) as { id: number; nombre: string }[]; const rolLabel = profile.rol === 'admin' ? 'Administrador' : profile.rol === 'docente' ? 'Docente' : 'Alumno'; const info = avatarInfo({ email: profile.email, nombre: profile.nombre, fotoPath: profile.foto_path, googleAvatarUrl, }); ---
Mi perfil

{profile.nombre ?? profile.email.split('@')[0]}

{profile.email}

{rolLabel}

Datos del perfil