feat(i18n): traducir la ficha del alumno
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,10 +5,12 @@ import { useAttendeeDetail } from './AttendeeDetailProvider'
|
||||
import { ACTION_BUTTON_CLASS, PRIMARY_ACTION_CLASS } from './actionButton'
|
||||
import { Section } from './Section'
|
||||
import { useCopyToClipboard } from './useCopyToClipboard'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export function AbsenceLinkSection() {
|
||||
const { attendee } = useAttendeeDetail()
|
||||
const { copied, copy } = useCopyToClipboard()
|
||||
const { t } = useTranslation(['attendeeDetail', 'common'])
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
const panelId = useId()
|
||||
|
||||
@@ -19,14 +21,14 @@ export function AbsenceLinkSection() {
|
||||
const phoneDigits = attendee.phone?.replace(/\D/g, '') ?? ''
|
||||
const shareUrl = phoneDigits
|
||||
? `https://wa.me/${phoneDigits}?text=${encodeURIComponent(
|
||||
`Hola ${attendee.fullName.split(' ')[0]}, desde este link podés avisar tus ausencias en ${url}`,
|
||||
t('absenceLink.message', { name: attendee.fullName.split(' ')[0], url }),
|
||||
)}`
|
||||
: null
|
||||
|
||||
return (
|
||||
<Section
|
||||
title="Link de ausencias"
|
||||
description="Para que avise si no puede venir"
|
||||
title={t('absenceLink.title')}
|
||||
description={t('absenceLink.description')}
|
||||
toggle={{ isOpen, panelId, onToggle: () => setIsOpen((value) => !value) }}
|
||||
>
|
||||
{/* The panel stays in the DOM but hidden: `aria-controls` always resolves and
|
||||
@@ -43,18 +45,18 @@ export function AbsenceLinkSection() {
|
||||
className={cn(ACTION_BUTTON_CLASS, 'w-full')}
|
||||
>
|
||||
<Copy className="size-4" aria-hidden="true" />
|
||||
Copiar link
|
||||
{t('absenceLink.copy')}
|
||||
</button>
|
||||
{shareUrl ? (
|
||||
<a
|
||||
href={shareUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label={`Enviar el link por WhatsApp a ${attendee.fullName}`}
|
||||
aria-label={t('absenceLink.sendLabel', { name: attendee.fullName })}
|
||||
className={PRIMARY_ACTION_CLASS}
|
||||
>
|
||||
<MessageCircle className="size-4" aria-hidden="true" />
|
||||
Enviar por WhatsApp
|
||||
{t('absenceLink.send')}
|
||||
</a>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -65,7 +67,7 @@ export function AbsenceLinkSection() {
|
||||
{copied ? (
|
||||
<>
|
||||
<Check className="size-3.5" aria-hidden="true" />
|
||||
Link copiado
|
||||
{t('absenceLink.copied')}
|
||||
</>
|
||||
) : null}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user