feat(i18n): traducir la ficha del alumno
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import { AttendeeContactForm } from './AttendeeContactForm'
|
||||
import { contactEmailError } from './detail'
|
||||
import { Section } from './Section'
|
||||
import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export function AttendeeContactSection() {
|
||||
const {
|
||||
@@ -18,6 +19,7 @@ export function AttendeeContactSection() {
|
||||
isUpdatingAttendee,
|
||||
} = useAttendeeDetail()
|
||||
const [phone, setPhone] = useState('')
|
||||
const { t } = useTranslation(['attendeeDetail', 'common'])
|
||||
const [email, setEmail] = useState('')
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
@@ -47,8 +49,8 @@ export function AttendeeContactSection() {
|
||||
} catch (err) {
|
||||
setError(
|
||||
err instanceof ApiError && err.problem?.code === 'person_phone_taken'
|
||||
? 'Ese teléfono ya es de otra persona que tenés registrada.'
|
||||
: 'No pudimos guardar los cambios. Revisá tu conexión e intentá de nuevo.',
|
||||
? t('contact.phoneTaken')
|
||||
: t('contact.saveError'),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -56,7 +58,7 @@ export function AttendeeContactSection() {
|
||||
return (
|
||||
<Section
|
||||
id="attendee-contact"
|
||||
title="Contacto"
|
||||
title={t('contact.title')}
|
||||
trailing={
|
||||
!isEditingContact ? (
|
||||
<button
|
||||
@@ -64,7 +66,7 @@ export function AttendeeContactSection() {
|
||||
onClick={beginContactEdit}
|
||||
className="min-h-11 rounded-lg px-2 text-sm font-medium text-accent-fg transition-colors hover:bg-primary-soft hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent"
|
||||
>
|
||||
Editar
|
||||
{t('contact.edit')}
|
||||
</button>
|
||||
) : null
|
||||
}
|
||||
@@ -76,7 +78,7 @@ export function AttendeeContactSection() {
|
||||
error={error}
|
||||
sharedNote={
|
||||
attendee.otherGroups.length > 0
|
||||
? 'El cambio se aplica en todos sus grupos.'
|
||||
? t('contact.shared')
|
||||
: null
|
||||
}
|
||||
isSaving={isUpdatingAttendee}
|
||||
@@ -95,15 +97,15 @@ export function AttendeeContactSection() {
|
||||
<div className="divide-y divide-border/60">
|
||||
<ContactRow
|
||||
icon={Phone}
|
||||
label="Teléfono"
|
||||
value={formatPhoneDisplay(attendee.phone) ?? 'Agregar teléfono'}
|
||||
label={t('contact.phone')}
|
||||
value={formatPhoneDisplay(attendee.phone) ?? t('contact.addPhone')}
|
||||
href={attendee.phone ? `tel:${attendee.phone.replace(/\D/g, '')}` : undefined}
|
||||
placeholder={!attendee.phone}
|
||||
/>
|
||||
<ContactRow
|
||||
icon={Mail}
|
||||
label="Email"
|
||||
value={attendee.email ?? 'Agregar email'}
|
||||
label={t('contact.email')}
|
||||
value={attendee.email ?? t('contact.addEmail')}
|
||||
href={attendee.email ? `mailto:${attendee.email}` : undefined}
|
||||
placeholder={!attendee.email}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user