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 { alertDetail, alertLabel, reminderMessage, whatsappLink, type AttentionItem } from './attention' import { SeverityAvatar } from './SeverityAvatar' const ACTION_CLASS = 'inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-xl px-3 text-sm font-semibold transition-colors focus-visible:ring-2 focus-visible:ring-accent focus-visible:outline-none motion-reduce:transition-none' type AttentionCardProps = { item: AttentionItem onResolve: () => void } 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 ? 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 ? 'bg-primary text-background hover:bg-primary/90' : 'bg-primary-soft text-primary hover:bg-border' return (
{student.fullName}

{student.groupName}

{label}

{alertDetail(alert)}

{href ? ( {actionLabel} ) : ( )}
) }