diff --git a/apps/backend/test/student-alerts.test.ts b/apps/backend/test/student-alerts.test.ts index d3a32ea..9fd216e 100644 --- a/apps/backend/test/student-alerts.test.ts +++ b/apps/backend/test/student-alerts.test.ts @@ -95,6 +95,8 @@ describe('computeStudentAlerts: pagos', () => { gravedad: 'vigilar', etiqueta: 'Cuota vencida', detalle: 'La cuota de octubre venció el 10/10.', + razon: 'cuota', + valores: { cuotas: 1, vencimientos: ['2026-10-10T12:00:00.000Z'] }, firma: 'pay_1', peso: 1, }, diff --git a/apps/web/src/features/attention/AttentionCard.tsx b/apps/web/src/features/attention/AttentionCard.tsx index 6e325e0..73abff8 100644 --- a/apps/web/src/features/attention/AttentionCard.tsx +++ b/apps/web/src/features/attention/AttentionCard.tsx @@ -1,8 +1,9 @@ import { Link } from '@tanstack/react-router' import { Check } from 'lucide-react' +import { useTranslation } from 'react-i18next' import { cn } from '../../lib/utils' import { AlertTag } from './AlertTag' -import { reminderMessage, whatsappLink, type AttentionItem } from './attention' +import { alertDetail, alertLabel, reminderMessage, whatsappLink, type AttentionItem } from './attention' import { SeverityAvatar } from './SeverityAvatar' const ACTION_CLASS = @@ -15,10 +16,12 @@ type AttentionCardProps = { export function AttentionCard({ item, onResolve }: AttentionCardProps) { const { student, alert } = item + const { t } = useTranslation('attention') + const label = alertLabel(alert) const urgent = alert.gravedad === 'urgente' const isPayment = alert.tipo === 'pago' - const actionLabel = isPayment ? 'Enviar recordatorio' : 'Contactar' + const actionLabel = isPayment ? t('card.remind') : t('card.contact') const href = whatsappLink(student, isPayment ? reminderMessage(student) : undefined) // Urgent: light fill, the strongest action on screen. To watch: subtle gray. const primaryTone = urgent @@ -39,10 +42,10 @@ export function AttentionCard({ item, onResolve }: AttentionCardProps) {

{student.groupName}

- {alert.etiqueta} + {label} -

{alert.detalle}

+

{alertDetail(alert)}

{href ? ( @@ -50,7 +53,7 @@ export function AttentionCard({ item, onResolve }: AttentionCardProps) { href={href} target="_blank" rel="noopener noreferrer" - aria-label={`${actionLabel} a ${student.fullName} por WhatsApp`} + aria-label={t('card.actionWhatsapp', { action: actionLabel, name: student.fullName })} className={cn(ACTION_CLASS, primaryTone)} > {actionLabel} @@ -59,7 +62,7 @@ export function AttentionCard({ item, onResolve }: AttentionCardProps) {
diff --git a/apps/web/src/features/attention/AttentionHeader.tsx b/apps/web/src/features/attention/AttentionHeader.tsx index 69e1ea2..b127db5 100644 --- a/apps/web/src/features/attention/AttentionHeader.tsx +++ b/apps/web/src/features/attention/AttentionHeader.tsx @@ -1,5 +1,6 @@ import { Link } from '@tanstack/react-router' import { ArrowLeft, ListFilter } from 'lucide-react' +import { useTranslation } from 'react-i18next' import { createPortal } from 'react-dom' import { useImmersiveBarHost } from '../../context/ImmersiveBarProvider' @@ -10,18 +11,19 @@ import { useImmersiveBarHost } from '../../context/ImmersiveBarProvider' sticky box, like `LargeTitle`. */ export function AttentionHeader({ subtitle }: { subtitle: string }) { const host = useImmersiveBarHost() + const { t } = useTranslation('attention') const bar = (