import { CalendarX2, Loader2, Lock, Receipt, CalendarDays } from 'lucide-react' import { Avatar, Button } from '../../components/ui' import { LinkUsedView } from './LinkUsedView' import { StudentAuthShell } from './StudentAuthShell' import { useStudentLink } from './StudentLinkProvider' const CAPABILITIES = [ { icon: CalendarX2, text: 'Avisar si no vas a una clase' }, { icon: Receipt, text: 'Informar pagos con el comprobante' }, { icon: CalendarDays, text: 'Ver tus próximas clases' }, ] export function StudentLinkView() { const { info, infoPending, infoFailed, enter, entering, consumedElsewhere, enterFailed } = useStudentLink() if (infoPending) { return (
) } if (infoFailed || !info || info.status === 'invalid' || consumedElsewhere) { return } const firstName = info.name.split(' ')[0] ?? info.name const isRecovery = info.kind === 'recovery' return (

Hola, {firstName}

{isRecovery ? 'Este es tu link para volver a entrar a gruperly.' : info.teacherName && info.groupName ? `${info.teacherName} te invitó a ${info.groupName} en gruperly.` : 'Te invitaron a gruperly.'}

{isRecovery ? null : (
    {CAPABILITIES.map(({ icon: Icon, text }) => (
  • ))}
)}
{enterFailed ? (

No pudimos conectarte. Revisá tu conexión y probá de nuevo.

) : null}

) }