feat(i18n): traducir la ficha del alumno
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import type { LucideIcon } from 'lucide-react'
|
||||
import { History, Link2, Loader2, Trash2, UserPlus, Users } from 'lucide-react'
|
||||
import { Button, Modal } from '../../components/ui'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
|
||||
type Consequence = { key: string; icon: LucideIcon; text: string }
|
||||
|
||||
@@ -26,6 +27,7 @@ export function ConfirmRemoveAttendeeDialog({
|
||||
} = useAttendeeDetail()
|
||||
|
||||
const wasOpen = useRef(false)
|
||||
const { t } = useTranslation(['attendeeDetail', 'common'])
|
||||
const contentRef = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -52,27 +54,23 @@ export function ConfirmRemoveAttendeeDialog({
|
||||
{
|
||||
key: 'historial',
|
||||
icon: History,
|
||||
text: 'Se borra su historial: las clases registradas y las ausencias que avisó dejan de existir.',
|
||||
text: t('remove.history'),
|
||||
},
|
||||
]
|
||||
if (attendee.notifyToken) {
|
||||
consequences.push({ key: 'link', icon: Link2, text: 'El link de ausencias deja de funcionar.' })
|
||||
consequences.push({ key: 'link', icon: Link2, text: t('remove.link') })
|
||||
}
|
||||
consequences.push({
|
||||
key: 'lugar',
|
||||
icon: Users,
|
||||
text: waiting
|
||||
? `Se libera 1 lugar. Hay ${waitlistTotal} ${
|
||||
waitlistTotal === 1 ? 'persona' : 'personas'
|
||||
} en lista de espera.`
|
||||
: 'Se libera 1 lugar en el grupo.',
|
||||
text: waiting ? t('remove.spotWaiting', { count: waitlistTotal }) : t('remove.spot'),
|
||||
})
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isRemoveDialogOpen}
|
||||
onClose={closeRemoveDialog}
|
||||
title="Quitar del grupo"
|
||||
title={t('remove.title')}
|
||||
description={`${attendee.fullName}${groupName ? ` · ${groupName}` : ''}`}
|
||||
maxWidth="sm"
|
||||
>
|
||||
@@ -87,15 +85,18 @@ export function ConfirmRemoveAttendeeDialog({
|
||||
</ul>
|
||||
|
||||
<p className="text-xs text-foreground">
|
||||
Si tiene cobros registrados no se va a poder quitar: primero hay que gestionarlos.
|
||||
{t('remove.paymentsNote')}
|
||||
</p>
|
||||
|
||||
{canPromote && firstWaitlistEntry ? (
|
||||
<div className="rounded-xl bg-accent-soft p-3.5">
|
||||
<p className="text-sm text-foreground">
|
||||
Si lo quitás, podés darle el lugar a{' '}
|
||||
<strong className="text-primary">{firstWaitlistEntry.fullName}</strong>, el primero
|
||||
de la lista de espera.
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="remove.promote"
|
||||
values={{ name: firstWaitlistEntry.fullName }}
|
||||
components={{ strong: <strong className="text-primary" /> }}
|
||||
/>
|
||||
</p>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -108,14 +109,14 @@ export function ConfirmRemoveAttendeeDialog({
|
||||
) : (
|
||||
<UserPlus className="size-4" />
|
||||
)}
|
||||
<span>Pasar a {firstWaitlistEntry.fullName} al grupo</span>
|
||||
<span>{t('remove.promoteAction', { name: firstWaitlistEntry.fullName })}</span>
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div className="flex flex-col-reverse gap-2.5 border-t border-border pt-3 sm:flex-row sm:justify-end">
|
||||
<Button variant="ghost" onClick={closeRemoveDialog} autoFocus>
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
{/* Label in black on the `danger` fill: it is the only way to reach AA
|
||||
with the same red in both themes (4.9:1 light, 6.7:1 dark); in white
|
||||
@@ -130,7 +131,7 @@ export function ConfirmRemoveAttendeeDialog({
|
||||
) : (
|
||||
<Trash2 className="size-4" />
|
||||
)}
|
||||
<span>Quitar del grupo</span>
|
||||
<span>{t('remove.confirm')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user