- Grupos: subtítulo con resumen (grupos · alumnos · lugares libres), sección "Requiere atención" con los 4 alumnos más urgentes y tarjetas con avatares (punteados por lugar libre en grupos chicos, superpuestos con "+N" en grandes; con alerta primero y anillo de gravedad). - Pantalla nueva /groups/attention: filtros Todos/Asistencia/Pagos, secciones Urgente y A vigilar, Contactar / Enviar recordatorio por wa.me y "Resuelto" persistente con update optimista. - FAB "Nuevo grupo" que se pliega al scrollear (respeta reduced motion); los toasts en mobile suben para no quedar debajo. - Alertas centralizadas en computeStudentAlerts (shared). La regla de asistencia pasa a: urgente = 3 seguidas o 4 de las últimas 6; a vigilar = 2 de las últimas 4 (sin inactividad por días ni tendencia). Cuotas: 1 vencida vigilar, 2+ urgente. - Backend: GET /attention y POST /attention/:attendeeId/resolve; tabla attendee_alert_resolutions (la alerta vuelve si cambia la firma). - Tokens de gravedad para claro y oscuro; se quita el indicador de pills. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
import type { AttentionMember } from '@gruperly/shared'
|
|
import { cn } from '../../lib/utils'
|
|
import { SeverityAvatar } from '../attention/SeverityAvatar'
|
|
import { avatarRow } from './card'
|
|
|
|
type AvatarRowProps = {
|
|
members: AttentionMember[]
|
|
capacity: number | null
|
|
occupied: number
|
|
}
|
|
|
|
/** The members of a group as faces: the same language for any size. */
|
|
export function AvatarRow({ members, capacity, occupied }: AvatarRowProps) {
|
|
const { stacked, slots } = avatarRow(members, capacity, occupied)
|
|
|
|
return (
|
|
<div className={cn('flex min-w-0 items-center', stacked ? '' : 'gap-2')} aria-hidden="true">
|
|
{slots.map((slot, index) => {
|
|
const overlap = stacked && index > 0 && '-ml-1.5'
|
|
if (slot.kind === 'member') {
|
|
return (
|
|
<SeverityAvatar
|
|
key={slot.member.attendeeId}
|
|
name={slot.member.fullName}
|
|
seed={slot.member.attendeeId}
|
|
severity={slot.severity}
|
|
stacked={stacked}
|
|
className={cn(overlap || undefined)}
|
|
/>
|
|
)
|
|
}
|
|
if (slot.kind === 'free') {
|
|
return (
|
|
<span
|
|
key={slot.key}
|
|
className="size-8 shrink-0 rounded-full border border-dashed border-foreground/60"
|
|
/>
|
|
)
|
|
}
|
|
return (
|
|
<span
|
|
key="more"
|
|
className={cn(
|
|
'flex size-8 shrink-0 items-center justify-center rounded-full bg-primary-soft text-[11px] font-semibold text-secondary ring-2 ring-surface',
|
|
overlap,
|
|
)}
|
|
>
|
|
+{slot.count}
|
|
</span>
|
|
)
|
|
})}
|
|
</div>
|
|
)
|
|
}
|