feat(i18n): traducir Grupos (lista, ficha, alta de miembros y estadísticas)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Copy, Loader2, MessageCircle, RefreshCw } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Button, Input, Label, Modal } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -16,13 +17,14 @@ export function InviteLinkModal() {
|
||||
copyWhatsappMessage,
|
||||
openWhatsapp,
|
||||
} = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isInviteModalOpen}
|
||||
onClose={closeInviteModal}
|
||||
title="Compartir Link de Invitación"
|
||||
description="Envía este enlace a tus miembros para que completen sus datos e ingresen directamente al grupo."
|
||||
title={t('invite.title')}
|
||||
description={t('invite.description')}
|
||||
maxWidth="md"
|
||||
>
|
||||
<div className="space-y-5">
|
||||
@@ -34,7 +36,7 @@ export function InviteLinkModal() {
|
||||
<>
|
||||
<div>
|
||||
<Label htmlFor="invite-link-input" className="mb-1.5 block">
|
||||
Enlace único del grupo
|
||||
{t('invite.linkLabel')}
|
||||
</Label>
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
@@ -47,35 +49,36 @@ export function InviteLinkModal() {
|
||||
variant="outline"
|
||||
onClick={() => void copyInviteLink()}
|
||||
className="shrink-0 gap-1.5 px-3"
|
||||
title="Copiar al portapapeles"
|
||||
title={t('invite.copyTitle')}
|
||||
>
|
||||
<Copy className="size-4" />
|
||||
<span>Copiar</span>
|
||||
<span>{t('invite.copy')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2.5 rounded-xl border border-accent/20 bg-accent-soft p-4 text-xs text-foreground/80">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="font-semibold text-primary">Vista previa del mensaje para WhatsApp:</p>
|
||||
<p className="font-semibold text-primary">{t('invite.previewTitle')}</p>
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => void copyWhatsappMessage()}
|
||||
className="h-7 shrink-0 gap-1.5 px-2 text-xs text-primary hover:text-primary/80"
|
||||
title="Copiar mensaje completo al portapapeles"
|
||||
title={t('invite.copyMessageTitle')}
|
||||
>
|
||||
<Copy className="size-3.5" />
|
||||
<span>Copiar mensaje</span>
|
||||
<span>{t('invite.copyMessage')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
<div className="whitespace-pre-line rounded-lg border border-accent/10 bg-surface/70 p-3 font-sans text-xs leading-relaxed text-foreground">
|
||||
{`¡Hola! 👋 Te invito a unirte al grupo `}
|
||||
<strong>{group?.name}</strong>.
|
||||
{'\n\n'}
|
||||
Completa tu pre-inscripción en el siguiente enlace. El profesor revisará tu solicitud:
|
||||
{'\n'}
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="invite.messagePreview"
|
||||
values={{ group: group?.name ?? '' }}
|
||||
components={{ strong: <strong /> }}
|
||||
/>
|
||||
<span className="break-all text-accent underline">{inviteUrl}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,7 +90,7 @@ export function InviteLinkModal() {
|
||||
className="w-full gap-2 border-0 bg-[#25D366] text-white hover:bg-[#1EBE5D] sm:flex-1"
|
||||
>
|
||||
<MessageCircle className="size-4" />
|
||||
<span>Abrir en WhatsApp</span>
|
||||
<span>{t('invite.openWhatsapp')}</span>
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
@@ -96,18 +99,22 @@ export function InviteLinkModal() {
|
||||
onClick={regenerateInvite}
|
||||
disabled={isRegeneratingInvite}
|
||||
className="w-full gap-1.5 text-xs text-foreground/60 hover:text-danger sm:w-auto"
|
||||
title="Invalida el enlace anterior y genera uno nuevo"
|
||||
title={t('invite.regenerateTitle')}
|
||||
>
|
||||
<RefreshCw className={cn('size-3.5', isRegeneratingInvite && 'animate-spin')} />
|
||||
<span>Regenerar enlace</span>
|
||||
<span>{t('invite.regenerate')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<p className="text-center text-[11px] font-normal leading-normal text-foreground/50 sm:text-left">
|
||||
Al hacer clic en <strong>Abrir en WhatsApp</strong>, el mensaje completo se copia
|
||||
automáticamente al portapapeles. Si WhatsApp Web solo carga el enlace, podés pegarlo
|
||||
directamente con <kbd className="rounded bg-primary-soft px-1 py-0.5 font-mono text-[10px] text-primary">Ctrl+V</kbd>{' '}
|
||||
o <kbd className="rounded bg-primary-soft px-1 py-0.5 font-mono text-[10px] text-primary">Cmd+V</kbd>.
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="invite.footnote"
|
||||
components={{
|
||||
strong: <strong />,
|
||||
kbd: <kbd className="rounded bg-primary-soft px-1 py-0.5 font-mono text-[10px] text-primary" />,
|
||||
}}
|
||||
/>
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user