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,5 +1,6 @@
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { AlertTag } from '../attention/AlertTag'
|
||||
import type { FlaggedStudent } from '../attention/attention'
|
||||
import { SeverityAvatar } from '../attention/SeverityAvatar'
|
||||
@@ -8,6 +9,7 @@ const PREVIEW_LIMIT = 4
|
||||
|
||||
/** "Requiere atención" on Grupos: the most urgent students, one row each. */
|
||||
export function AttentionPreview({ students }: { students: FlaggedStudent[] }) {
|
||||
const { t } = useTranslation('groups')
|
||||
if (students.length === 0) return null
|
||||
|
||||
return (
|
||||
@@ -17,18 +19,18 @@ export function AttentionPreview({ students }: { students: FlaggedStudent[] }) {
|
||||
id="attention-preview-title"
|
||||
className="flex items-center gap-2 text-xs font-semibold tracking-wider text-alert-urgent-fg uppercase"
|
||||
>
|
||||
Requiere atención
|
||||
{t('attentionPreview.title')}
|
||||
<span className="inline-flex min-w-5 items-center justify-center rounded-full bg-alert-urgent-soft px-1.5 py-0.5 text-[11px] leading-none tabular-nums">
|
||||
<span className="sr-only">: </span>
|
||||
{students.length}
|
||||
<span className="sr-only"> {students.length === 1 ? 'alumno' : 'alumnos'}</span>
|
||||
<span aria-hidden="true">{students.length}</span>
|
||||
<span className="sr-only">{t('attentionPreview.students', { count: students.length })}</span>
|
||||
</span>
|
||||
</h2>
|
||||
<Link
|
||||
to="/groups/attention"
|
||||
className="-mr-2 inline-flex min-h-11 items-center gap-0.5 rounded-xl px-2 text-sm font-medium text-accent-fg hover:underline focus-visible:ring-2 focus-visible:ring-accent focus-visible:outline-none"
|
||||
>
|
||||
Ver todos
|
||||
{t('attentionPreview.seeAll')}
|
||||
<ChevronRight className="size-4" aria-hidden="true" />
|
||||
</Link>
|
||||
</div>
|
||||
@@ -51,7 +53,7 @@ export function AttentionPreview({ students }: { students: FlaggedStudent[] }) {
|
||||
<span className="block truncate font-semibold text-primary">{student.fullName}</span>
|
||||
<span className="block truncate text-sm text-secondary">{student.groupName}</span>
|
||||
</span>
|
||||
<span className="sr-only">{student.worst.gravedad === 'urgente' ? 'Urgente:' : 'A vigilar:'}</span>
|
||||
<span className="sr-only">{student.worst.gravedad === 'urgente' ? t('attentionPreview.urgent') : t('attentionPreview.watch')}</span>
|
||||
<AlertTag severity={student.worst.gravedad}>{student.worst.etiqueta}</AlertTag>
|
||||
</Link>
|
||||
</li>
|
||||
|
||||
@@ -2,11 +2,14 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { Link, useNavigate } from '@tanstack/react-router'
|
||||
import type { CreateFirstGroup } from '@gruperly/shared'
|
||||
import { ChevronLeft } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { errorMessage } from '../../i18n'
|
||||
import { createGroup } from '../../lib/api'
|
||||
import { GroupForm } from './GroupForm'
|
||||
|
||||
export function CreateGroupView() {
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation('groups')
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
const create = useMutation({
|
||||
@@ -24,16 +27,16 @@ export function CreateGroupView() {
|
||||
className="mb-6 hidden items-center gap-1 text-sm font-medium text-foreground/70 transition-colors hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ChevronLeft className="size-4" />
|
||||
Grupos
|
||||
{t('title')}
|
||||
</Link>
|
||||
|
||||
<GroupForm
|
||||
heading="Nuevo grupo"
|
||||
description="Definí los datos de la clase que vas a cobrar. Después siempre podés editarlos."
|
||||
submitLabel="Crear grupo"
|
||||
heading={t('create.heading')}
|
||||
description={t('create.description')}
|
||||
submitLabel={t('create.submit')}
|
||||
isSubmitting={create.isPending}
|
||||
errorMessage={
|
||||
create.isError ? 'No pudimos crear el grupo. Revisá los datos e intentá de nuevo.' : null
|
||||
create.isError ? errorMessage(create.error, t('create.error')) : null
|
||||
}
|
||||
onSubmit={(values) => create.mutate(values)}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { AttentionMember, GroupListItem } from '@gruperly/shared'
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { AvatarRow } from './AvatarRow'
|
||||
import { groupStatus, type GroupStatus } from './card'
|
||||
@@ -22,11 +23,12 @@ type GroupCardProps = {
|
||||
}
|
||||
|
||||
export function GroupCard({ group, members }: GroupCardProps) {
|
||||
const { t } = useTranslation('groups')
|
||||
const status = members ? groupStatus(members, group.capacity, group.attendeesCount) : null
|
||||
const occupancy =
|
||||
group.capacity === null
|
||||
? `${group.attendeesCount} ${group.attendeesCount === 1 ? 'alumno' : 'alumnos'}`
|
||||
: `${group.attendeesCount} de ${group.capacity} lugares ocupados`
|
||||
? t('card.students', { count: group.attendeesCount })
|
||||
: t('card.occupancy', { count: group.attendeesCount, capacity: group.capacity })
|
||||
|
||||
return (
|
||||
<Link
|
||||
|
||||
@@ -3,10 +3,11 @@ import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import type { BillingType, CountryCode, CreateFirstGroup, WeekDay } from '@gruperly/shared'
|
||||
import { CreateFirstGroupSchema, DEFAULT_COUNTRY } from '@gruperly/shared'
|
||||
import { ArrowLeft, Check, Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { sortWeekDays } from '../../lib/format'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { Button, FieldError, Input, Label } from '../../components/ui'
|
||||
import { BILLING_TYPES, WEEK_DAY_CHIPS } from '../onboarding/constants'
|
||||
import { BILLING_TYPES, WEEK_DAYS } from '../onboarding/constants'
|
||||
|
||||
type GroupFormProps = {
|
||||
heading: string
|
||||
@@ -30,6 +31,7 @@ export function GroupForm({
|
||||
onSubmit,
|
||||
onBack,
|
||||
}: GroupFormProps) {
|
||||
const { t } = useTranslation(['groups', 'common'])
|
||||
// The price starts empty on purpose: a pre-filled $0 got submitted as is and
|
||||
// the group ended up unable to charge. The capacity starts at a typical
|
||||
// class size instead of 1, which had to be overwritten every time.
|
||||
@@ -76,11 +78,11 @@ export function GroupForm({
|
||||
</header>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="name">Nombre del grupo</Label>
|
||||
<Label htmlFor="name">{t('form.name')}</Label>
|
||||
<Input
|
||||
id="name"
|
||||
autoFocus
|
||||
placeholder="Ej: Yoga Vinyasa · Nivel 1"
|
||||
placeholder={t('form.namePlaceholder')}
|
||||
invalid={!!errors.name}
|
||||
{...register('name')}
|
||||
/>
|
||||
@@ -88,9 +90,9 @@ export function GroupForm({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label>Días de clase</Label>
|
||||
<Label>{t('form.days')}</Label>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{WEEK_DAY_CHIPS.map(({ value, label }) => {
|
||||
{WEEK_DAYS.map((value) => {
|
||||
const isActive = days.includes(value)
|
||||
return (
|
||||
<button
|
||||
@@ -105,7 +107,7 @@ export function GroupForm({
|
||||
: 'border-border bg-surface text-primary hover:bg-primary-soft',
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
{t(`common:weekDayShort.${value}`)}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
@@ -114,7 +116,7 @@ export function GroupForm({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="time">Horario</Label>
|
||||
<Label htmlFor="time">{t('form.time')}</Label>
|
||||
<Input
|
||||
id="time"
|
||||
type="time"
|
||||
@@ -126,7 +128,7 @@ export function GroupForm({
|
||||
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<Label htmlFor="capacity">Cupo máximo</Label>
|
||||
<Label htmlFor="capacity">{t('form.capacity')}</Label>
|
||||
<Input
|
||||
id="capacity"
|
||||
type="number"
|
||||
@@ -140,7 +142,7 @@ export function GroupForm({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="price">Precio</Label>
|
||||
<Label htmlFor="price">{t('form.price')}</Label>
|
||||
<div className="relative">
|
||||
<span className="pointer-events-none absolute inset-y-0 left-3 flex items-center text-base text-foreground/50 sm:text-sm">
|
||||
$
|
||||
@@ -151,7 +153,7 @@ export function GroupForm({
|
||||
inputMode="decimal"
|
||||
min={0}
|
||||
step="0.01"
|
||||
placeholder="Por alumno"
|
||||
placeholder={t('form.pricePlaceholder')}
|
||||
className="pl-7"
|
||||
invalid={!!errors.price}
|
||||
{...register('price', { valueAsNumber: true })}
|
||||
@@ -162,9 +164,9 @@ export function GroupForm({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label>Tipo de cobro</Label>
|
||||
<Label>{t('form.billingType')}</Label>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{BILLING_TYPES.map(({ value, label, hint }) => {
|
||||
{BILLING_TYPES.map((value) => {
|
||||
const isActive = billingType === value
|
||||
return (
|
||||
<button
|
||||
@@ -185,9 +187,9 @@ export function GroupForm({
|
||||
isActive ? 'text-accent' : 'text-primary',
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
{t(`common:billingType.${value}`)}
|
||||
</span>
|
||||
<span className="block text-xs text-foreground/50">{hint}</span>
|
||||
<span className="block text-xs text-foreground/50">{t(`common:billingTypeHint.${value}`)}</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
@@ -195,7 +197,7 @@ export function GroupForm({
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="dueDay">Día de vencimiento</Label>
|
||||
<Label htmlFor="dueDay">{t('form.dueDay')}</Label>
|
||||
<Input
|
||||
id="dueDay"
|
||||
type="number"
|
||||
@@ -207,7 +209,7 @@ export function GroupForm({
|
||||
{...register('dueDay', { valueAsNumber: true })}
|
||||
/>
|
||||
<p className="mt-1 text-xs text-foreground/50">
|
||||
Los cobros vencerán el día {isFinite(dueDay) && dueDay ? dueDay : '1'} de cada mes.
|
||||
{t('form.dueDayHint', { day: isFinite(dueDay) && dueDay ? dueDay : 1 })}
|
||||
</p>
|
||||
<FieldError message={errors.dueDay?.message} />
|
||||
</div>
|
||||
@@ -220,12 +222,12 @@ export function GroupForm({
|
||||
{onBack ? (
|
||||
<Button variant="outline" onClick={onBack} disabled={isSubmitting}>
|
||||
<ArrowLeft className="size-4" />
|
||||
Volver
|
||||
{t('common:actions.back')}
|
||||
</Button>
|
||||
) : null}
|
||||
<Button type="submit" variant="primary" className="flex-1" disabled={isSubmitting}>
|
||||
{isSubmitting ? <Loader2 className="size-4 animate-spin" /> : <Check className="size-4" />}
|
||||
{isSubmitting ? 'Creando…' : submitLabel}
|
||||
{isSubmitting ? t('form.submitting') : submitLabel}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { CalendarPlus, Loader2, Plus } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button } from '../../components/ui'
|
||||
import { getGroups } from '../../lib/api'
|
||||
import { flaggedStudents } from '../attention/attention'
|
||||
@@ -12,6 +13,7 @@ import { NewGroupFab } from './NewGroupFab'
|
||||
|
||||
export function GroupsView() {
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation(['groups', 'common'])
|
||||
const groupsQuery = useQuery({
|
||||
queryKey: ['groups'],
|
||||
queryFn: getGroups,
|
||||
@@ -24,21 +26,21 @@ export function GroupsView() {
|
||||
return (
|
||||
// The FAB floats over the last card: 88px of room so it can be read.
|
||||
<section className="pb-[88px]">
|
||||
<h1 className="text-2xl font-bold text-primary">Grupos</h1>
|
||||
<h1 className="text-2xl font-bold text-primary">{t('title')}</h1>
|
||||
{hasGroups ? <p className="mt-1 text-sm text-secondary">{groupsSummary(groups)}</p> : null}
|
||||
|
||||
{groupsQuery.isPending ? (
|
||||
<div className="mt-8 flex items-center justify-center py-16" role="status">
|
||||
<Loader2 className="size-6 animate-spin text-secondary/50" aria-hidden="true" />
|
||||
<span className="sr-only">Cargando grupos</span>
|
||||
<span className="sr-only">{t('loading')}</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{groupsQuery.isError ? (
|
||||
<div className="mt-8 space-y-3 rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger">
|
||||
<p>No pudimos cargar tus grupos.</p>
|
||||
<p>{t('loadError')}</p>
|
||||
<Button variant="outline" size="sm" onClick={() => void groupsQuery.refetch()}>
|
||||
Reintentar
|
||||
{t('common:actions.retry')}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -50,9 +52,9 @@ export function GroupsView() {
|
||||
<span className="mx-auto flex size-14 items-center justify-center rounded-2xl bg-accent-soft text-accent-fg">
|
||||
<CalendarPlus className="size-7" aria-hidden="true" />
|
||||
</span>
|
||||
<p className="mt-4 text-base font-semibold text-primary">Todavía no tenés grupos</p>
|
||||
<p className="mt-4 text-base font-semibold text-primary">{t('empty.title')}</p>
|
||||
<p className="mx-auto mt-1.5 max-w-[30ch] text-sm leading-relaxed text-secondary">
|
||||
Creá tu primer grupo y empezá a cobrar las cuotas de tus alumnos.
|
||||
{t('empty.description')}
|
||||
</p>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -60,7 +62,7 @@ export function GroupsView() {
|
||||
onClick={() => void navigate({ to: '/groups/new' })}
|
||||
>
|
||||
<Plus className="size-4" />
|
||||
Crear primer grupo
|
||||
{t('empty.cta')}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -74,7 +76,7 @@ export function GroupsView() {
|
||||
id="my-groups-title"
|
||||
className="text-xs font-semibold tracking-wider text-secondary uppercase"
|
||||
>
|
||||
Mis grupos
|
||||
{t('myGroups')}
|
||||
</h2>
|
||||
<div className="mt-2 grid gap-3 lg:grid-cols-2">
|
||||
{groups.map((group) => (
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { Plus } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useCollapseOnScroll } from '../../hooks/useCollapseOnScroll'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
@@ -9,11 +10,12 @@ import { cn } from '../../lib/utils'
|
||||
accessible name never changes. `motion-reduce` swaps without animating. */
|
||||
export function NewGroupFab() {
|
||||
const collapsed = useCollapseOnScroll()
|
||||
const { t } = useTranslation('groups')
|
||||
|
||||
return (
|
||||
<Link
|
||||
to="/groups/new"
|
||||
aria-label="Nuevo grupo"
|
||||
aria-label={t('newGroup')}
|
||||
className="fixed right-4 bottom-[calc(3.5rem+env(safe-area-inset-bottom)+1rem)] z-40 inline-flex h-14 items-center rounded-[18px] bg-accent px-4 font-semibold text-on-accent shadow-[0_10px_28px_-8px_rgb(37_68_234/0.65)] transition-colors hover:bg-accent-strong focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none lg:right-8 lg:bottom-8"
|
||||
>
|
||||
<Plus className="size-6 shrink-0" strokeWidth={2.25} aria-hidden="true" />
|
||||
@@ -24,7 +26,7 @@ export function NewGroupFab() {
|
||||
collapsed ? 'ml-0 max-w-0 opacity-0' : 'ml-2 max-w-40 opacity-100',
|
||||
)}
|
||||
>
|
||||
Nuevo grupo
|
||||
{t('newGroup')}
|
||||
</span>
|
||||
</Link>
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { ArrowLeft, Loader2 } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { useAddAttendee } from './AddAttendeeProvider'
|
||||
import { BulkCapacityModal } from './BulkCapacityModal'
|
||||
@@ -8,13 +9,14 @@ import { CapacityModal } from './CapacityModal'
|
||||
import { QuickAddForm } from './QuickAddForm'
|
||||
|
||||
const TABS = [
|
||||
{ value: 'quick' as const, label: 'Carga Rápida (Individual)' },
|
||||
{ value: 'bulk' as const, label: 'Carga Masiva (CSV / Excel)' },
|
||||
{ value: 'quick' as const, label: 'tabs.quick' as const },
|
||||
{ value: 'bulk' as const, label: 'tabs.bulk' as const },
|
||||
]
|
||||
|
||||
export function AddAttendeePage() {
|
||||
const { groupId, groupName, attendeesTotal, capacity, groupPending, activeTab, setActiveTab } =
|
||||
useAddAttendee()
|
||||
const { t } = useTranslation('groupAdd')
|
||||
|
||||
if (groupPending) {
|
||||
return (
|
||||
@@ -32,24 +34,26 @@ export function AddAttendeePage() {
|
||||
className="hidden items-center gap-1 text-sm text-foreground/60 transition-colors hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ArrowLeft className="size-4" />
|
||||
<span>Volver al grupo</span>
|
||||
<span>{t('back')}</span>
|
||||
</Link>
|
||||
|
||||
<header className="space-y-1">
|
||||
<h1 className="text-2xl font-bold text-primary">Agregar miembros</h1>
|
||||
<h1 className="text-2xl font-bold text-primary">{t('title')}</h1>
|
||||
<p className="text-sm text-foreground/60">
|
||||
{groupName ? (
|
||||
<>
|
||||
Sumá miembros a <span className="font-medium text-primary">{groupName}</span> de forma
|
||||
individual o masiva desde una lista.
|
||||
</>
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="subtitleGroup"
|
||||
values={{ group: groupName }}
|
||||
components={{ strong: <span className="font-medium text-primary" /> }}
|
||||
/>
|
||||
) : (
|
||||
'Sumá miembros de forma individual o masiva desde una lista.'
|
||||
t('subtitle')
|
||||
)}
|
||||
</p>
|
||||
{capacity != null ? (
|
||||
<p className="text-xs text-foreground/50">
|
||||
{attendeesTotal} de {capacity} lugares ocupados.
|
||||
{t('occupancy', { count: attendeesTotal, capacity })}
|
||||
</p>
|
||||
) : null}
|
||||
</header>
|
||||
@@ -68,7 +72,7 @@ export function AddAttendeePage() {
|
||||
: 'text-foreground/60 hover:text-primary',
|
||||
)}
|
||||
>
|
||||
{tab.label}
|
||||
{t(tab.label)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -3,13 +3,17 @@ import type { ReactNode } from 'react'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import type {
|
||||
BulkCreateAttendeesResult,
|
||||
CreateAttendee,
|
||||
CreateAttendeeResult,
|
||||
CreateGroupWaitlistEntry,
|
||||
GroupWaitlistEntryDto,
|
||||
GroupWaitlistList,
|
||||
} from '@gruperly/shared'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useToast } from '../../../components/ui'
|
||||
import { errorMessage } from '../../../i18n'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import {
|
||||
addToGroupWaitlist,
|
||||
ApiError,
|
||||
@@ -72,6 +76,7 @@ const AddAttendeeContext = createContext<AddAttendeeContextValue | null>(null)
|
||||
export function AddAttendeeProvider({ groupId, children }: { groupId: string; children: ReactNode }) {
|
||||
const queryClient = useQueryClient()
|
||||
const toast = useToast()
|
||||
useTranslation()
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [activeTab, setActiveTab] = useState<AddAttendeeTab>('quick')
|
||||
@@ -116,11 +121,12 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
void queryClient.invalidateQueries({ queryKey: ['group', groupId] })
|
||||
}
|
||||
|
||||
const handleCreateSuccess = (result: CreateAttendeeResult) => {
|
||||
const handleCreateSuccess = (result: CreateAttendeeResult, payload: CreateAttendee) => {
|
||||
if (result.outcome === 'created') {
|
||||
toast.success(`Miembro ${result.attendee.fullName} agregado con éxito.`)
|
||||
toast.success(i18n.t('groupAdd:toast.created', { name: result.attendee.fullName }))
|
||||
} else {
|
||||
toast.info(result.message)
|
||||
const name = `${payload.firstName} ${payload.lastName ?? ''}`.trim()
|
||||
toast.info(i18n.t('groupAdd:toast.waitlisted', { name }))
|
||||
}
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-attendees', groupId] })
|
||||
// Si era alguien de otro grupo, su ficha allá ahora lo muestra también acá.
|
||||
@@ -142,10 +148,10 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
// refresca la búsqueda para que aparezca la opción de agregar a esa persona.
|
||||
if (err instanceof ApiError && err.problem?.code === 'person_exists') {
|
||||
void queryClient.invalidateQueries({ queryKey: ['person-lookup', groupId] })
|
||||
toast.info('Ya tenés registrada a una persona con este teléfono. Podés agregarla a este grupo.')
|
||||
toast.info(i18n.t('groupAdd:toast.personExists'))
|
||||
return
|
||||
}
|
||||
toast.error(err.message || 'Error al agregar miembro.')
|
||||
toast.error(errorMessage(err, i18n.t('groupAdd:toast.addError')))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -153,7 +159,7 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
mutationFn: (payload: CreateAttendee) => createAttendee(groupId, payload, { allowOverflow: true }),
|
||||
onSuccess: handleCreateSuccess,
|
||||
onError: (err: Error) => {
|
||||
toast.error(err.message || 'Error al agregar miembro.')
|
||||
toast.error(errorMessage(err, i18n.t('groupAdd:toast.addError')))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -187,7 +193,7 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
return { previousWaitlist }
|
||||
},
|
||||
onSuccess: (entry) => {
|
||||
toast.info(`${entry.fullName} fue agregado a la lista de espera del grupo.`)
|
||||
toast.info(i18n.t('groupAdd:toast.waitlisted', { name: entry.fullName }))
|
||||
invalidateGroupQueries()
|
||||
goBackToGroup()
|
||||
},
|
||||
@@ -196,9 +202,9 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
queryClient.setQueryData<GroupWaitlistList>(['group-waitlist', groupId], context.previousWaitlist)
|
||||
}
|
||||
if (err instanceof ApiError && err.problem?.code === 'already_waitlisted') {
|
||||
toast.info('Este número ya está en la lista de espera del grupo.')
|
||||
toast.info(i18n.t('groupAdd:toast.alreadyWaitlisted'))
|
||||
} else {
|
||||
toast.error(err.message || 'Error al agregar a la lista de espera.')
|
||||
toast.error(errorMessage(err, i18n.t('groupAdd:toast.waitlistError')))
|
||||
}
|
||||
closeCapacityFlow()
|
||||
},
|
||||
@@ -207,14 +213,14 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
const bulkImportMutation = useMutation({
|
||||
mutationFn: (rows: BulkAttendeeRow[]) => bulkCreateAttendees(groupId, { attendees: rows }),
|
||||
onSuccess: (res) => {
|
||||
toast.success(res.message)
|
||||
toast.success(importSummary(res))
|
||||
setParsedContacts([])
|
||||
setFileName(null)
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-attendees', groupId] })
|
||||
goBackToGroup()
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
toast.error(err.message || 'Error al importar miembros.')
|
||||
toast.error(errorMessage(err, i18n.t('groupAdd:toast.importError')))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -235,7 +241,7 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
|
||||
const runBulkImport = () => {
|
||||
if (validRows.length === 0) {
|
||||
toast.error('No hay miembros válidos para importar.')
|
||||
toast.error(i18n.t('groupAdd:bulk.noValidRows'))
|
||||
return
|
||||
}
|
||||
bulkImportMutation.mutate(validRows)
|
||||
@@ -243,7 +249,7 @@ export function AddAttendeeProvider({ groupId, children }: { groupId: string; ch
|
||||
|
||||
const requestBulkImport = () => {
|
||||
if (validRows.length === 0) {
|
||||
toast.error('No hay miembros válidos para importar.')
|
||||
toast.error(i18n.t('groupAdd:bulk.noValidRows'))
|
||||
return
|
||||
}
|
||||
if (capacity != null && attendeesTotal + validRows.length > capacity) {
|
||||
@@ -310,3 +316,16 @@ export function useAddAttendee() {
|
||||
}
|
||||
return context
|
||||
}
|
||||
|
||||
/** The bulk import summary, built from the counts (the API's `message` is Spanish only). */
|
||||
function importSummary(result: BulkCreateAttendeesResult): string {
|
||||
return [
|
||||
i18n.t('groupAdd:toast.imported', { count: result.createdCount }),
|
||||
result.linkedCount > 0 ? i18n.t('groupAdd:toast.importedLinked', { count: result.linkedCount }) : null,
|
||||
result.duplicatesCount > 0
|
||||
? i18n.t('groupAdd:toast.importedDuplicates', { count: result.duplicatesCount })
|
||||
: null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Check } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { useAddAttendee } from './AddAttendeeProvider'
|
||||
|
||||
@@ -12,24 +13,28 @@ export function BulkCapacityModal() {
|
||||
groupName,
|
||||
capacity,
|
||||
} = useAddAttendee()
|
||||
const { t } = useTranslation(['groupAdd', 'common'])
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isBulkCapacityModalOpen}
|
||||
onClose={closeBulkCapacityModal}
|
||||
title="Aviso de cupo"
|
||||
description="La carga supera el cupo del grupo."
|
||||
title={t('bulkCapacity.title')}
|
||||
description={t('bulkCapacity.description')}
|
||||
maxWidth="md"
|
||||
>
|
||||
<div className="space-y-4">
|
||||
<p className="text-sm text-foreground/70">
|
||||
Estás por importar <strong className="text-primary">{validRowsCount}</strong> miembro(s), pero el
|
||||
grupo ya tiene <strong className="text-primary">{attendeesTotal}</strong> inscrito(s) y su cupo es
|
||||
de <strong className="text-primary">{capacity}</strong>. ¿Deseas importarlos de todos modos?
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="bulkCapacity.body"
|
||||
values={{ rows: validRowsCount, current: attendeesTotal, capacity }}
|
||||
components={{ strong: <strong className="text-primary" /> }}
|
||||
/>
|
||||
</p>
|
||||
<div className="flex flex-col-reverse gap-2.5 pt-2 sm:flex-row sm:items-center sm:justify-end">
|
||||
<Button variant="ghost" onClick={closeBulkCapacityModal} className="w-full sm:w-auto">
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -37,7 +42,7 @@ export function BulkCapacityModal() {
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
<Check className="size-4" />
|
||||
Importar de todos modos
|
||||
{t('bulkCapacity.confirm')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useRef } from 'react'
|
||||
import { Check, Download, FileSpreadsheet, Loader2, Trash2, UploadCloud } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Badge, Button, useToast } from '../../../components/ui'
|
||||
import {
|
||||
downloadAttendeeTemplateCsv,
|
||||
@@ -28,12 +29,13 @@ export function BulkImportPanel() {
|
||||
requestBulkImport,
|
||||
} = useAddAttendee()
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation(['groupAdd', 'common'])
|
||||
const fileInputRef = useRef<HTMLInputElement>(null)
|
||||
|
||||
const processFile = async (file: File) => {
|
||||
const fileExtension = file.name.split('.').pop()?.toLowerCase()
|
||||
if (!['csv', 'xlsx', 'xls', 'txt'].includes(fileExtension ?? '')) {
|
||||
toast.error('Formato no compatible. Sube un archivo .csv o .xlsx')
|
||||
toast.error(t('bulk.unsupported'))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -47,14 +49,14 @@ export function BulkImportPanel() {
|
||||
|
||||
const contacts = normalizeRowsToContacts(rawRows)
|
||||
if (contacts.length === 0) {
|
||||
toast.error('No se detectaron contactos en el archivo.')
|
||||
toast.error(t('bulk.noContacts'))
|
||||
} else {
|
||||
setParsedContacts(contacts)
|
||||
const validCount = contacts.filter((c) => c.isValid).length
|
||||
toast.info(`Se detectaron ${contacts.length} filas (${validCount} válidas).`)
|
||||
toast.info(t('bulk.detected', { count: contacts.length, valid: validCount }))
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
const message = err instanceof Error ? err.message : 'Error al procesar el archivo.'
|
||||
const message = err instanceof Error ? err.message : t('bulk.processError')
|
||||
toast.error(message)
|
||||
} finally {
|
||||
setIsParsingFile(false)
|
||||
@@ -103,9 +105,9 @@ export function BulkImportPanel() {
|
||||
/>
|
||||
<UploadCloud className="mb-2 size-10 text-accent" />
|
||||
<p className="text-sm font-semibold text-primary">
|
||||
Arrastra tu archivo aquí o haz clic para seleccionarlo
|
||||
{t('bulk.dropzone')}
|
||||
</p>
|
||||
<p className="mt-1 text-xs text-foreground/60">Formatos soportados: CSV (.csv) o Excel (.xlsx)</p>
|
||||
<p className="mt-1 text-xs text-foreground/60">{t('bulk.formats')}</p>
|
||||
|
||||
{fileName ? (
|
||||
<div className="mt-3 flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-1.5 text-xs font-medium text-primary">
|
||||
@@ -116,21 +118,21 @@ export function BulkImportPanel() {
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-start gap-1 px-1 text-xs sm:flex-row sm:items-center sm:justify-between">
|
||||
<span className="text-foreground/60">¿No tienes el archivo listo? Usa nuestra plantilla.</span>
|
||||
<span className="text-foreground/60">{t('bulk.templateHint')}</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={downloadAttendeeTemplateCsv}
|
||||
className="inline-flex shrink-0 items-center gap-1 whitespace-nowrap font-medium text-accent transition-colors hover:text-accent-strong"
|
||||
>
|
||||
<Download className="size-3.5" />
|
||||
<span>Descargar plantilla CSV</span>
|
||||
<span>{t('bulk.downloadTemplate')}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{isParsingFile ? (
|
||||
<div className="flex items-center justify-center gap-2 py-6 text-sm text-foreground/60">
|
||||
<Loader2 className="size-4 animate-spin text-accent" />
|
||||
<span>Leyendo y analizando archivo...</span>
|
||||
<span>{t('bulk.parsing')}</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -138,9 +140,9 @@ export function BulkImportPanel() {
|
||||
<div className="space-y-3 pt-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2 text-xs">
|
||||
<span className="font-semibold text-primary">Vista Previa:</span>
|
||||
<Badge variant="success">{validRowsCount} listos para importar</Badge>
|
||||
{invalidRowsCount > 0 ? <Badge variant="danger">{invalidRowsCount} con errores</Badge> : null}
|
||||
<span className="font-semibold text-primary">{t('bulk.preview')}</span>
|
||||
<Badge variant="success">{t('bulk.ready', { count: validRowsCount })}</Badge>
|
||||
{invalidRowsCount > 0 ? <Badge variant="danger">{t('bulk.withErrors', { count: invalidRowsCount })}</Badge> : null}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
@@ -152,7 +154,7 @@ export function BulkImportPanel() {
|
||||
}}
|
||||
className="h-7 px-2 text-xs text-foreground/50 hover:text-danger"
|
||||
>
|
||||
Limpiar lista
|
||||
{t('bulk.clear')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -160,10 +162,10 @@ export function BulkImportPanel() {
|
||||
<table className="w-full text-left text-xs">
|
||||
<thead className="sticky top-0 border-b border-border bg-surface font-semibold text-foreground/70">
|
||||
<tr>
|
||||
<th className="px-3 py-2">Nombre</th>
|
||||
<th className="px-3 py-2">Teléfono</th>
|
||||
<th className="px-3 py-2">Email</th>
|
||||
<th className="px-3 py-2">Estado</th>
|
||||
<th className="px-3 py-2">{t('bulk.name')}</th>
|
||||
<th className="px-3 py-2">{t('bulk.phone')}</th>
|
||||
<th className="px-3 py-2">{t('bulk.email')}</th>
|
||||
<th className="px-3 py-2">{t('bulk.status')}</th>
|
||||
<th className="px-2 py-2 text-right" />
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -174,16 +176,16 @@ export function BulkImportPanel() {
|
||||
className={!contact.isValid ? 'bg-danger-soft/30' : 'hover:bg-primary-soft/30'}
|
||||
>
|
||||
<td className="px-3 py-2 font-medium text-primary">
|
||||
{contact.fullName || <span className="italic text-danger">Sin nombre</span>}
|
||||
{contact.fullName || <span className="italic text-danger">{t('bulk.noName')}</span>}
|
||||
</td>
|
||||
<td className="px-3 py-2 text-foreground/80">
|
||||
{contact.phone || <span className="italic text-danger">Sin teléfono</span>}
|
||||
{contact.phone || <span className="italic text-danger">{t('bulk.noPhone')}</span>}
|
||||
</td>
|
||||
<td className="px-3 py-2 text-foreground/60">{contact.email || '—'}</td>
|
||||
<td className="px-3 py-2">
|
||||
{contact.isValid ? (
|
||||
<Badge variant="success" className="py-0 text-[10px]">
|
||||
Válido
|
||||
{t('bulk.valid')}
|
||||
</Badge>
|
||||
) : (
|
||||
<Badge variant="danger" className="py-0 text-[10px]" title={contact.error}>
|
||||
@@ -196,7 +198,7 @@ export function BulkImportPanel() {
|
||||
type="button"
|
||||
onClick={() => removeParsedContact(contact.id)}
|
||||
className="rounded p-1 text-foreground/40 transition-colors hover:text-danger"
|
||||
title="Eliminar fila"
|
||||
title={t('bulk.removeRow')}
|
||||
>
|
||||
<Trash2 className="size-3.5" />
|
||||
</button>
|
||||
@@ -209,7 +211,7 @@ export function BulkImportPanel() {
|
||||
|
||||
<div className="flex flex-col-reverse gap-2.5 border-t border-border pt-3 sm:flex-row sm:items-center sm:justify-end">
|
||||
<Button variant="ghost" onClick={cancelAddAttendee} className="w-full sm:w-auto">
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -218,7 +220,7 @@ export function BulkImportPanel() {
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
{isSubmittingBulkImport ? <Loader2 className="size-4 animate-spin" /> : <Check className="size-4" />}
|
||||
<span>Confirmar e Importar ({validRowsCount})</span>
|
||||
<span>{t('bulk.confirm', { count: validRowsCount })}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Clock, Loader2, UserPlus } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { useAddAttendee } from './AddAttendeeProvider'
|
||||
|
||||
@@ -14,25 +15,30 @@ export function CapacityModal() {
|
||||
isSubmittingForcedAttendee,
|
||||
isSubmittingWaitlistEntry,
|
||||
} = useAddAttendee()
|
||||
const { t } = useTranslation('groupAdd')
|
||||
const isBusy = isSubmittingForcedAttendee || isSubmittingWaitlistEntry
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={isCapacityModalOpen}
|
||||
onClose={closeCapacityModal}
|
||||
title="Cupo alcanzado"
|
||||
description="El grupo llegó a su cupo máximo de miembros."
|
||||
title={t('capacity.title')}
|
||||
description={t('capacity.description')}
|
||||
maxWidth="md"
|
||||
>
|
||||
{capacityPayload ? (
|
||||
<div className="space-y-4">
|
||||
<p className="text-sm text-foreground/70">
|
||||
El grupo <strong className="text-primary">{groupName}</strong> ya alcanzó su cupo de{' '}
|
||||
<strong className="text-primary">{capacity}</strong> miembros. ¿Qué deseas hacer con{' '}
|
||||
<strong className="text-primary">
|
||||
{`${capacityPayload.firstName.trim()} ${(capacityPayload.lastName ?? '').trim()}`.trim()}
|
||||
</strong>
|
||||
?
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="capacity.body"
|
||||
values={{
|
||||
group: groupName ?? '',
|
||||
capacity,
|
||||
name: `${capacityPayload.firstName.trim()} ${(capacityPayload.lastName ?? '').trim()}`.trim(),
|
||||
}}
|
||||
components={{ strong: <strong className="text-primary" /> }}
|
||||
/>
|
||||
</p>
|
||||
<div className="flex flex-col gap-2.5">
|
||||
<Button
|
||||
@@ -46,7 +52,7 @@ export function CapacityModal() {
|
||||
) : (
|
||||
<UserPlus className="size-4" />
|
||||
)}
|
||||
<span>Agregar de todos modos</span>
|
||||
<span>{t('capacity.force')}</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
@@ -59,11 +65,11 @@ export function CapacityModal() {
|
||||
) : (
|
||||
<Clock className="size-4" />
|
||||
)}
|
||||
<span>Sumar a la lista de espera</span>
|
||||
<span>{t('capacity.waitlist')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-center text-[11px] text-foreground/50">
|
||||
Si eliges agregarlo de todos modos, el grupo quedará por encima de su cupo.
|
||||
{t('capacity.forceHint')}
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { UserCheck } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import type { PersonSummary } from '@gruperly/shared'
|
||||
import { Button } from '../../../components/ui'
|
||||
|
||||
@@ -22,12 +23,13 @@ export function ExistingPersonNotice({
|
||||
onUnlink,
|
||||
onChangePhone,
|
||||
}: ExistingPersonNoticeProps) {
|
||||
const { t } = useTranslation('groupAdd')
|
||||
const groupNames = person.groups.map((group) => group.groupName).join(', ')
|
||||
|
||||
if (alreadyInGroup) {
|
||||
return (
|
||||
<div role="alert" className="mt-2 rounded-xl bg-danger-soft px-3 py-2.5 text-sm text-danger-fg">
|
||||
{person.fullName} ya es miembro de este grupo.
|
||||
{t('existing.alreadyInGroup', { name: person.fullName })}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -38,30 +40,29 @@ export function ExistingPersonNotice({
|
||||
<UserCheck className="mt-0.5 size-4 shrink-0 text-accent-fg" aria-hidden="true" />
|
||||
<p className="min-w-0">
|
||||
{isLinked ? (
|
||||
<>
|
||||
Vas a agregar a <strong>{person.fullName}</strong> a este grupo. Sus datos de contacto
|
||||
y notas son los mismos que en sus otros grupos.
|
||||
</>
|
||||
<Trans t={t} i18nKey="existing.linked" values={{ name: person.fullName }} components={{ strong: <strong /> }} />
|
||||
) : (
|
||||
<>
|
||||
Ya tenés a <strong>{person.fullName}</strong> con este teléfono
|
||||
{groupNames ? ` (en ${groupNames})` : ''}. ¿Es la misma persona?
|
||||
</>
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey={groupNames ? 'existing.foundInGroups' : 'existing.found'}
|
||||
values={{ name: person.fullName, groups: groupNames }}
|
||||
components={{ strong: <strong /> }}
|
||||
/>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mt-2.5 flex flex-wrap justify-end gap-2">
|
||||
{isLinked ? (
|
||||
<Button variant="ghost" onClick={onUnlink} size="sm">
|
||||
No es esta persona
|
||||
{t('existing.notThisPerson')}
|
||||
</Button>
|
||||
) : (
|
||||
<>
|
||||
<Button variant="ghost" onClick={onChangePhone} size="sm">
|
||||
Usar otro teléfono
|
||||
{t('existing.otherPhone')}
|
||||
</Button>
|
||||
<Button variant="primary" onClick={onLink} size="sm">
|
||||
Sí, agregarla
|
||||
{t('existing.confirm')}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useRef, useState } from 'react'
|
||||
import { Check, Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button, Input, Label, useToast } from '../../../components/ui'
|
||||
import { useAddAttendee } from './AddAttendeeProvider'
|
||||
import { ExistingPersonNotice } from './ExistingPersonNotice'
|
||||
@@ -8,6 +9,7 @@ import { usePersonLookup } from './usePersonLookup'
|
||||
export function QuickAddForm() {
|
||||
const { groupId, submitQuickAttendee, isSubmittingAttendee, cancelAddAttendee } = useAddAttendee()
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation(['groupAdd', 'common'])
|
||||
const [firstName, setFirstName] = useState('')
|
||||
const [lastName, setLastName] = useState('')
|
||||
const [phone, setPhone] = useState('')
|
||||
@@ -39,11 +41,11 @@ export function QuickAddForm() {
|
||||
return
|
||||
}
|
||||
if (mustLink) {
|
||||
toast.info('Ese teléfono ya es de una persona registrada: agregala o usá otro teléfono.')
|
||||
toast.info(t('quick.mustLink'))
|
||||
return
|
||||
}
|
||||
if (!firstName.trim() || !phone.trim()) {
|
||||
toast.error('Nombre y teléfono son obligatorios.')
|
||||
toast.error(t('quick.required'))
|
||||
return
|
||||
}
|
||||
submitQuickAttendee({
|
||||
@@ -69,11 +71,11 @@ export function QuickAddForm() {
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
<div>
|
||||
<Label htmlFor="quick-first-name" className="mb-1 block text-xs">
|
||||
Nombre <span className="text-danger">*</span>
|
||||
{t('quick.firstName')} <span className="text-danger">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="quick-first-name"
|
||||
placeholder="Ej. Lucas"
|
||||
placeholder={t('quick.firstNamePlaceholder')}
|
||||
value={linkedPerson ? linkedPerson.fullName : firstName}
|
||||
onChange={(e) => setFirstName(e.target.value)}
|
||||
disabled={isLinked}
|
||||
@@ -82,11 +84,11 @@ export function QuickAddForm() {
|
||||
</div>
|
||||
<div>
|
||||
<Label htmlFor="quick-last-name" className="mb-1 block text-xs">
|
||||
Apellido
|
||||
{t('quick.lastName')}
|
||||
</Label>
|
||||
<Input
|
||||
id="quick-last-name"
|
||||
placeholder="Ej. González"
|
||||
placeholder={t('quick.lastNamePlaceholder')}
|
||||
value={isLinked ? '' : lastName}
|
||||
onChange={(e) => setLastName(e.target.value)}
|
||||
disabled={isLinked}
|
||||
@@ -96,11 +98,11 @@ export function QuickAddForm() {
|
||||
|
||||
<div>
|
||||
<Label htmlFor="quick-phone" className="mb-1 block text-xs">
|
||||
Teléfono / WhatsApp <span className="text-danger">*</span>
|
||||
{t('quick.phone')} <span className="text-danger">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="quick-phone"
|
||||
placeholder="Ej. +54 9 11 2345-6789"
|
||||
placeholder={t('quick.phonePlaceholder')}
|
||||
ref={phoneRef}
|
||||
value={phone}
|
||||
onChange={(e) => {
|
||||
@@ -123,19 +125,19 @@ export function QuickAddForm() {
|
||||
/>
|
||||
) : (
|
||||
<p className="mt-1 text-[11px] text-foreground/50">
|
||||
Usado para contacto y validación de duplicados.
|
||||
{t('quick.phoneHint')}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label htmlFor="quick-email" className="mb-1 block text-xs">
|
||||
Email (opcional)
|
||||
{t('quick.email')}
|
||||
</Label>
|
||||
<Input
|
||||
id="quick-email"
|
||||
type="email"
|
||||
placeholder="alumno@ejemplo.com"
|
||||
placeholder={t('quick.emailPlaceholder')}
|
||||
value={linkedPerson ? (linkedPerson.email ?? '') : email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
disabled={isLinked}
|
||||
@@ -144,11 +146,11 @@ export function QuickAddForm() {
|
||||
|
||||
<div>
|
||||
<Label htmlFor="quick-notes" className="mb-1 block text-xs">
|
||||
Notas u Observaciones (opcional)
|
||||
{t('quick.notes')}
|
||||
</Label>
|
||||
<Input
|
||||
id="quick-notes"
|
||||
placeholder="Ej. Nivel intermedio, trae materiales propios"
|
||||
placeholder={t('quick.notesPlaceholder')}
|
||||
value={notes}
|
||||
onChange={(e) => setNotes(e.target.value)}
|
||||
disabled={isLinked}
|
||||
@@ -164,7 +166,7 @@ export function QuickAddForm() {
|
||||
}}
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -173,7 +175,7 @@ export function QuickAddForm() {
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
{isSubmittingAttendee ? <Loader2 className="size-4 animate-spin" /> : <Check className="size-4" />}
|
||||
<span>Guardar Miembro</span>
|
||||
<span>{t('quick.submit')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -3,8 +3,10 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { Link, useParams } from '@tanstack/react-router'
|
||||
import type { GroupDto, StudentAtRiskDto } from '@gruperly/shared'
|
||||
import { ArrowLeft, CalendarCheck, DoorOpen, Loader2, Percent, Users } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { LargeTitle } from '../../../components/layout/LargeTitle'
|
||||
import { Badge, Button, useToast } from '../../../components/ui'
|
||||
import { errorMessage, useIntlLocale } from '../../../i18n'
|
||||
import { getAttendeeHistory, getGroupAnalytics, getStudentsAtRisk, updateAttendeeStatus } from '../../../lib/api'
|
||||
import { KpiCard } from './KpiCard'
|
||||
import { AtRiskStudentCard, type StatusAction } from './AtRiskStudentCard'
|
||||
@@ -15,6 +17,8 @@ export function AnalyticsView() {
|
||||
const { groupId } = useParams({ strict: false }) as { groupId: string }
|
||||
const queryClient = useQueryClient()
|
||||
const toast = useToast()
|
||||
const { t } = useTranslation(['analytics', 'common', 'groupDetail'])
|
||||
const locale = useIntlLocale()
|
||||
|
||||
const [historyStudent, setHistoryStudent] = useState<StudentAtRiskDto | null>(null)
|
||||
const [statusAction, setStatusAction] = useState<StatusAction>(null)
|
||||
@@ -45,8 +49,8 @@ export function AnalyticsView() {
|
||||
const name = action.student.fullName.split(' ')[0]
|
||||
toast.success(
|
||||
action.status === 'DROPPED'
|
||||
? `${name} fue dado de baja del grupo. Su vacante quedó disponible.`
|
||||
: `La vacante de ${name} quedó pausada.`,
|
||||
? t('status.dropped', { name })
|
||||
: t('status.paused', { name }),
|
||||
)
|
||||
setStatusAction(null)
|
||||
void queryClient.invalidateQueries({ queryKey: ['students-at-risk', groupId] })
|
||||
@@ -57,21 +61,18 @@ export function AnalyticsView() {
|
||||
void queryClient.invalidateQueries({ queryKey: ['groups-risk-overview'] })
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
toast.error(err.message || 'No pudimos actualizar el estado del alumno.')
|
||||
toast.error(errorMessage(err, t('status.error')))
|
||||
},
|
||||
})
|
||||
|
||||
const handleReengage = async (student: StudentAtRiskDto, groupName: string) => {
|
||||
if (!student.phone) return
|
||||
const firstName = student.fullName.split(' ')[0] ?? student.fullName
|
||||
const message =
|
||||
`¡Hola ${firstName}! 👋 Te extrañamos en ${groupName}. ` +
|
||||
'Notamos que no asististe a las últimas clases y queremos que vuelvas. ' +
|
||||
'Si tenés algún problema con tus horarios o tu membresía, escribinos y lo resolvemos juntos.'
|
||||
const message = t('atRisk.reengageMessage', { name: firstName, group: groupName })
|
||||
const waUrl = `https://wa.me/${student.phone.replace(/\D/g, '')}?text=${encodeURIComponent(message)}`
|
||||
try {
|
||||
await navigator.clipboard.writeText(message)
|
||||
toast.success('¡Abriendo WhatsApp! Mensaje copiado al portapapeles.')
|
||||
toast.success(t('atRisk.openingWhatsapp'))
|
||||
} catch {
|
||||
// If clipboard fails, we still open WhatsApp with the message.
|
||||
}
|
||||
@@ -98,7 +99,7 @@ export function AnalyticsView() {
|
||||
the bar its height and stops the layout from jumping when the data
|
||||
arrives. */}
|
||||
<LargeTitle
|
||||
title={groupName ?? 'Grupo'}
|
||||
title={groupName ?? t('groupDetail:fallbackTitle')}
|
||||
leading={
|
||||
<Link
|
||||
to="/groups/$groupId"
|
||||
@@ -106,7 +107,7 @@ export function AnalyticsView() {
|
||||
className="hidden shrink-0 items-center gap-1 text-sm text-foreground/80 transition-colors hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ArrowLeft className="size-4" />
|
||||
Volver al grupo
|
||||
{t('back')}
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
@@ -116,14 +117,14 @@ export function AnalyticsView() {
|
||||
<div className="mt-2 flex flex-wrap items-center justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
<p className="text-[14px] font-semibold uppercase tracking-wide text-foreground/70">
|
||||
Estadísticas
|
||||
{t('subtitle')}
|
||||
</p>
|
||||
<p className="mt-0.5 text-pretty text-sm text-foreground/80">
|
||||
Asistencia y gestión de riesgo
|
||||
{t('description')}
|
||||
</p>
|
||||
</div>
|
||||
<span className="shrink-0 rounded-xl bg-primary-soft px-3 py-1.5 text-xs font-semibold text-foreground/70">
|
||||
Últimos 30 días
|
||||
{t('period')}
|
||||
</span>
|
||||
</div>
|
||||
</LargeTitle>
|
||||
@@ -136,8 +137,8 @@ export function AnalyticsView() {
|
||||
|
||||
{hasFailed ? (
|
||||
<div className="mt-6 rounded-xl border border-danger/20 bg-danger-soft p-6 text-danger">
|
||||
<h2 className="text-lg font-semibold">No pudimos cargar las estadísticas</h2>
|
||||
<p className="mt-2 text-sm">Verificá tu conexión e intentá de nuevo.</p>
|
||||
<h2 className="text-lg font-semibold">{t('loadError.title')}</h2>
|
||||
<p className="mt-2 text-sm">{t('loadError.description')}</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="mt-4"
|
||||
@@ -146,7 +147,7 @@ export function AnalyticsView() {
|
||||
void riskQuery.refetch()
|
||||
}}
|
||||
>
|
||||
Reintentar
|
||||
{t('common:actions.retry')}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -156,43 +157,43 @@ export function AnalyticsView() {
|
||||
<div className="mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3">
|
||||
<KpiCard
|
||||
icon={<Percent className="size-5" />}
|
||||
label="Asistencia promedio"
|
||||
label={t('kpi.attendanceRate')}
|
||||
value={`${analytics.attendanceRate}%`}
|
||||
hint="últimos 30 días"
|
||||
hint={t('kpi.attendanceRateHint')}
|
||||
/>
|
||||
<KpiCard
|
||||
icon={<CalendarCheck className="size-5" />}
|
||||
label="Asistencias del mes"
|
||||
value={analytics.totalPresent.toLocaleString('es-MX')}
|
||||
hint={`${analytics.totalClasses} clases dictadas`}
|
||||
label={t('kpi.present')}
|
||||
value={analytics.totalPresent.toLocaleString(locale)}
|
||||
hint={t('kpi.presentHint', { count: analytics.totalClasses })}
|
||||
/>
|
||||
<KpiCard
|
||||
icon={<DoorOpen className="size-5" />}
|
||||
label="Cupos recuperados"
|
||||
value={analytics.recoveredSlots.toLocaleString('es-MX')}
|
||||
hint="por ausencias avisadas"
|
||||
label={t('kpi.recovered')}
|
||||
value={analytics.recoveredSlots.toLocaleString(locale)}
|
||||
hint={t('kpi.recoveredHint')}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-8">
|
||||
<div className="flex items-center gap-2">
|
||||
<Users className="size-5 text-accent" />
|
||||
<h2 className="text-lg font-semibold text-primary">Alumnos en riesgo</h2>
|
||||
<h2 className="text-lg font-semibold text-primary">{t('atRisk.title')}</h2>
|
||||
{atRisk.length > 0 ? (
|
||||
<Badge variant={atRisk.some((s) => s.riskLevel === 'HIGH') ? 'danger' : 'warning'}>
|
||||
{atRisk.length} {atRisk.length === 1 ? 'alumno' : 'alumnos'}
|
||||
{t('atRisk.count', { count: atRisk.length })}
|
||||
</Badge>
|
||||
) : null}
|
||||
</div>
|
||||
<p className="mt-1 text-sm text-foreground/60">
|
||||
Alumnos con faltas seguidas, que dejaron de venir o cuya asistencia viene en baja.
|
||||
{t('atRisk.description')}
|
||||
</p>
|
||||
|
||||
{atRisk.length === 0 ? (
|
||||
<div className="mt-4 rounded-xl border border-dashed border-border bg-surface px-4 py-10 text-center">
|
||||
<p className="font-medium text-primary">¡Sin alumnos en riesgo!</p>
|
||||
<p className="font-medium text-primary">{t('atRisk.emptyTitle')}</p>
|
||||
<p className="mt-1 text-sm text-foreground/60">
|
||||
No hay ausencias consecutivas ni asistencia por debajo del 50%.
|
||||
{t('atRisk.emptyDescription')}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
@@ -206,7 +207,7 @@ export function AnalyticsView() {
|
||||
setMenuOpenFor(menuOpenFor === student.attendeeId ? null : student.attendeeId)
|
||||
}
|
||||
onViewHistory={() => setHistoryStudent(student)}
|
||||
onReengage={() => void handleReengage(student, groupName ?? 'tu clase')}
|
||||
onReengage={() => void handleReengage(student, groupName ?? t('atRisk.yourClass'))}
|
||||
onRequestStatusAction={(action) => {
|
||||
setStatusAction(action)
|
||||
setMenuOpenFor(null)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { StudentAtRiskDto } from '@gruperly/shared'
|
||||
import { MessageCircle, MoreVertical, Pause, UserMinus } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Avatar, Badge, Button } from '../../../components/ui'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
|
||||
export type StatusAction = { student: StudentAtRiskDto; status: 'PAUSED' | 'DROPPED' } | null
|
||||
@@ -20,6 +22,7 @@ export function AtRiskStudentCard({
|
||||
onReengage: () => void
|
||||
onRequestStatusAction: (action: Exclude<StatusAction, null>) => void
|
||||
}) {
|
||||
const { t } = useTranslation('analytics')
|
||||
return (
|
||||
<li className="rounded-xl border border-border bg-surface p-4 transition-colors hover:border-accent/40">
|
||||
<div className="flex items-center gap-3">
|
||||
@@ -32,10 +35,9 @@ export function AtRiskStudentCard({
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-sm font-semibold text-primary">{student.fullName}</p>
|
||||
<p className="mt-0.5 text-xs text-foreground/50">
|
||||
{student.phone
|
||||
? `${formatPhoneDisplay(student.phone)} · `
|
||||
: 'Sin teléfono · '}
|
||||
{student.monthlyAttendanceRate}% de asistencia mensual
|
||||
{student.phone ? formatPhoneDisplay(student.phone) : t('atRisk.noPhone')}
|
||||
{' · '}
|
||||
{t('atRisk.monthlyRate', { rate: student.monthlyAttendanceRate })}
|
||||
</p>
|
||||
</div>
|
||||
</button>
|
||||
@@ -53,14 +55,14 @@ export function AtRiskStudentCard({
|
||||
className="flex-1 gap-2 border-0 bg-[#25D366] text-white hover:bg-[#1EBE5D] disabled:bg-foreground/10 disabled:text-foreground/40"
|
||||
>
|
||||
<MessageCircle className="size-4" />
|
||||
Reenganchar por WhatsApp
|
||||
{t('atRisk.reengage')}
|
||||
</Button>
|
||||
|
||||
<div className="relative">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
aria-label="Gestión de la vacante"
|
||||
aria-label={t('atRisk.manage')}
|
||||
onClick={onToggleMenu}
|
||||
>
|
||||
<MoreVertical className="size-4" />
|
||||
@@ -80,7 +82,7 @@ export function AtRiskStudentCard({
|
||||
className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-primary transition-colors hover:bg-primary-soft"
|
||||
>
|
||||
<Pause className="size-4" />
|
||||
Pausar vacante
|
||||
{t('atRisk.pause')}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
@@ -88,7 +90,7 @@ export function AtRiskStudentCard({
|
||||
className="flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger transition-colors hover:bg-danger-soft"
|
||||
>
|
||||
<UserMinus className="size-4" />
|
||||
Dar de baja
|
||||
{t('atRisk.drop')}
|
||||
</button>
|
||||
</div>
|
||||
</>
|
||||
@@ -105,10 +107,10 @@ const DAY_MS = 86_400_000
|
||||
then the time without coming, and last the declining trend (the only thing
|
||||
left that can flag someone with neither). */
|
||||
function riskReason(student: StudentAtRiskDto): string {
|
||||
if (student.consecutiveAbsences >= 2) return `${student.consecutiveAbsences} faltas seguidas`
|
||||
if (student.consecutiveAbsences >= 2) return i18n.t('analytics:atRisk.reasonStreak', { count: student.consecutiveAbsences })
|
||||
if (student.riskLevel === 'HIGH' && student.lastAttendedAt) {
|
||||
const days = Math.floor((Date.now() - new Date(student.lastAttendedAt).getTime()) / DAY_MS)
|
||||
return `${days} días sin venir`
|
||||
return i18n.t('analytics:atRisk.reasonDays', { count: days })
|
||||
}
|
||||
return 'Asistencia en baja'
|
||||
return i18n.t('analytics:atRisk.reasonTrend')
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { StudentAtRiskDto } from '@gruperly/shared'
|
||||
import { Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Modal } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { dotClass, formatSessionDate, sessionStatusTextClass, statusLabel } from './format'
|
||||
@@ -25,12 +26,13 @@ export function AttendeeHistoryModal({
|
||||
isError: boolean
|
||||
onClose: () => void
|
||||
}) {
|
||||
const { t } = useTranslation('analytics')
|
||||
return (
|
||||
<Modal
|
||||
isOpen={student !== null}
|
||||
onClose={onClose}
|
||||
title={student?.fullName ?? 'Historial'}
|
||||
description={student ? 'Historial de presentismo de las últimas clases.' : undefined}
|
||||
title={student?.fullName ?? t('history.title')}
|
||||
description={student ? t('history.description') : undefined}
|
||||
maxWidth="md"
|
||||
>
|
||||
{student ? (
|
||||
@@ -41,14 +43,14 @@ export function AttendeeHistoryModal({
|
||||
</div>
|
||||
) : isError || !sessions ? (
|
||||
<div className="rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger">
|
||||
No pudimos cargar el historial de este alumno.
|
||||
{t('history.error')}
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<div className="flex items-center gap-3 rounded-xl border border-border bg-primary-soft/50 p-3">
|
||||
<span className="text-2xl font-bold text-primary">{attendanceRate}%</span>
|
||||
<span className="text-xs font-medium uppercase text-foreground/60">
|
||||
Presentismo general ({sessions.length} clases)
|
||||
{t('history.overall', { count: sessions.length })}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Loader2, Pause, UserMinus } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import type { StatusAction } from './AtRiskStudentCard'
|
||||
@@ -16,35 +17,28 @@ export function StatusActionModal({
|
||||
onCancel: () => void
|
||||
onConfirm: () => void
|
||||
}) {
|
||||
const { t } = useTranslation(['analytics', 'common'])
|
||||
const title = action?.status === 'DROPPED' ? t('status.dropTitle') : t('status.pauseTitle')
|
||||
return (
|
||||
<Modal
|
||||
isOpen={action !== null}
|
||||
onClose={onCancel}
|
||||
title={action?.status === 'DROPPED' ? 'Dar de baja' : 'Pausar vacante'}
|
||||
title={title}
|
||||
maxWidth="md"
|
||||
>
|
||||
{action ? (
|
||||
<div className="space-y-4">
|
||||
<p className="text-sm text-foreground/70">
|
||||
{action.student.fullName}{' '}
|
||||
{action.status === 'DROPPED' ? (
|
||||
<>
|
||||
dejará de asistir al grupo y <strong className="text-primary">{groupName}</strong>. Su
|
||||
vacante quedará <strong className="text-primary">disponible</strong> para otro alumno, y
|
||||
su historial de asistencia se conservará.
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
será <strong className="text-primary">pausado</strong> en{' '}
|
||||
<strong className="text-primary">{groupName}</strong>. Su vacante quedará{' '}
|
||||
<strong className="text-primary">libre</strong> y podés reactivarla en cualquier
|
||||
momento.
|
||||
</>
|
||||
)}
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey={action.status === 'DROPPED' ? 'status.dropBody' : 'status.pauseBody'}
|
||||
values={{ name: action.student.fullName, group: groupName ?? '' }}
|
||||
components={{ strong: <strong className="text-primary" /> }}
|
||||
/>
|
||||
</p>
|
||||
<div className="flex flex-col gap-2.5 sm:flex-row sm:justify-end">
|
||||
<Button variant="outline" onClick={onCancel}>
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -62,7 +56,7 @@ export function StatusActionModal({
|
||||
) : (
|
||||
<Pause className="size-4" />
|
||||
)}
|
||||
<span>{action.status === 'DROPPED' ? 'Dar de baja' : 'Pausar vacante'}</span>
|
||||
<span>{title}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
|
||||
export function statusLabel(status: string | null): string {
|
||||
switch (status) {
|
||||
case 'PRESENT':
|
||||
return 'Presente'
|
||||
case 'ABSENT':
|
||||
return 'Ausente'
|
||||
case 'EXCUSED':
|
||||
return 'Avisó ausencia'
|
||||
return i18n.t(`common:attendanceStatus.${status}`)
|
||||
default:
|
||||
return 'Sin registrar'
|
||||
return i18n.t('common:attendanceStatus.NONE')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export function sessionStatusTextClass(status: string | null): string {
|
||||
}
|
||||
|
||||
export function formatSessionDate(iso: string): string {
|
||||
return new Date(iso).toLocaleDateString('es-MX', {
|
||||
return new Date(iso).toLocaleDateString(i18n.language, {
|
||||
weekday: 'short',
|
||||
day: 'numeric',
|
||||
month: 'short',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { AttentionGroup, AttentionMember, GroupListItem, StudentAlertSeverity, UrgentMemberSummary } from '@gruperly/shared'
|
||||
import { compareByWorstAlert, worstAlert } from '@gruperly/shared'
|
||||
import { i18n } from '../../i18n/instance'
|
||||
|
||||
/* Derivations for the group listing card. The card queries nothing: it decides
|
||||
here what is shown and in what order, so the JSX only builds the layout and
|
||||
@@ -74,12 +75,12 @@ export function groupStatus(
|
||||
const flagged = members.filter((member) => member.alerts.length > 0)
|
||||
if (flagged.length > 0) {
|
||||
const urgent = flagged.some((member) => member.alerts.some((alert) => alert.gravedad === 'urgente'))
|
||||
return { tone: urgent ? 'urgente' : 'vigilar', text: `${flagged.length} en riesgo` }
|
||||
return { tone: urgent ? 'urgente' : 'vigilar', text: i18n.t('groups:card.atRisk', { count: flagged.length }) }
|
||||
}
|
||||
if (capacity === null) return null
|
||||
const free = freeSpots(capacity, occupied)
|
||||
if (free > 0) return { tone: 'free', text: `${free} ${free === 1 ? 'libre' : 'libres'}` }
|
||||
return { tone: 'full', text: 'Completo' }
|
||||
if (free > 0) return { tone: 'free', text: i18n.t('groups:card.free', { count: free }) }
|
||||
return { tone: 'full', text: i18n.t('groups:card.full') }
|
||||
}
|
||||
|
||||
/** "4 grupos · 37 alumnos · 7 lugares libres" under the page title. */
|
||||
@@ -87,9 +88,9 @@ export function groupsSummary(groups: Pick<GroupListItem, 'attendeesCount' | 'ca
|
||||
const students = groups.reduce((total, group) => total + group.attendeesCount, 0)
|
||||
const free = groups.reduce((total, group) => total + freeSpots(group.capacity, group.attendeesCount), 0)
|
||||
return [
|
||||
plural(groups.length, 'grupo', 'grupos'),
|
||||
plural(students, 'alumno', 'alumnos'),
|
||||
plural(free, 'lugar libre', 'lugares libres'),
|
||||
i18n.t('groups:summary.groups', { count: groups.length }),
|
||||
i18n.t('groups:summary.students', { count: students }),
|
||||
i18n.t('groups:summary.freeSpots', { count: free }),
|
||||
].join(' · ')
|
||||
}
|
||||
|
||||
@@ -102,10 +103,6 @@ function freeSpots(capacity: number | null, occupied: number): number {
|
||||
return capacity === null ? 0 : Math.max(capacity - occupied, 0)
|
||||
}
|
||||
|
||||
function plural(count: number, one: string, many: string): string {
|
||||
return `${count} ${count === 1 ? one : many}`
|
||||
}
|
||||
|
||||
/* The reason Home shows next to an at-risk student: first a streak of absences
|
||||
(something that is going away), then the time since last showing up, and
|
||||
last the attendance rate. A single absence only names them when nothing else
|
||||
@@ -113,9 +110,9 @@ function plural(count: number, one: string, many: string): string {
|
||||
export function absenceReason(miembro: UrgentMemberSummary): string | null {
|
||||
const { consecutiveAbsences: faltas, daysSinceLastAttendance: dias, attendanceRate: asistencia } = miembro
|
||||
|
||||
if (faltas >= 2) return `${faltas} faltas`
|
||||
if (dias != null && dias > 0) return `${dias} ${dias === 1 ? 'día' : 'días'} sin venir`
|
||||
if (faltas === 1) return '1 falta'
|
||||
if (asistencia != null && asistencia < 100) return `asistencia ${asistencia}%`
|
||||
if (faltas >= 2) return i18n.t('groups:absence.streak', { count: faltas })
|
||||
if (dias != null && dias > 0) return i18n.t('groups:absence.daysAway', { count: dias })
|
||||
if (faltas === 1) return i18n.t('groups:absence.single')
|
||||
if (asistencia != null && asistencia < 100) return i18n.t('groups:absence.rate', { rate: asistencia })
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import type { GroupRiskLevel } from '@gruperly/shared'
|
||||
|
||||
export const RISK_LABELS: Record<Exclude<GroupRiskLevel, 'NONE'>, string> = {
|
||||
HIGH: 'Riesgo alto',
|
||||
MEDIUM: 'Riesgo moderado',
|
||||
}
|
||||
|
||||
/* The badge only says "Riesgo moderado"; this sentence explains what it is about
|
||||
(an attendee dropping out, not fraud or collections) and lives in the tooltip. */
|
||||
export const RISK_HINT =
|
||||
'Riesgo de abandono: probabilidad estimada de que algún miembro abandone el grupo.'
|
||||
/* Copy: `groups:risk.HIGH` / `groups:risk.MEDIUM`. The badge only says "Riesgo
|
||||
moderado"; `groups:risk.hint` explains what it is about (an attendee dropping
|
||||
out, not fraud or collections) and lives in the tooltip. */
|
||||
export type VisibleRiskLevel = Exclude<GroupRiskLevel, 'NONE'>
|
||||
|
||||
/* The concrete reason ("4 members with consecutive absences") is not computed
|
||||
here anymore: it lives in `card.ts`, which also decides the badge's visual
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import type { AbsenceReasonValue } from '@gruperly/shared'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Avatar, Badge } from '../../../components/ui'
|
||||
import { useIntlLocale } from '../../../i18n'
|
||||
import { getGroupAbsenceNotices } from '../../../lib/api'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
const REASON_LABELS: Record<AbsenceReasonValue, string> = {
|
||||
health: 'Salud',
|
||||
travel: 'Viaje',
|
||||
work_study: 'Trabajo o estudio',
|
||||
other: 'Otro',
|
||||
}
|
||||
|
||||
function classLabel(iso: string): string {
|
||||
function classLabel(iso: string, locale: string): string {
|
||||
return new Date(iso)
|
||||
.toLocaleString('es-AR', { weekday: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', hourCycle: 'h23' })
|
||||
.toLocaleString(locale, { weekday: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit', hourCycle: 'h23' })
|
||||
.replace(/\./g, '')
|
||||
}
|
||||
|
||||
@@ -21,6 +15,8 @@ function classLabel(iso: string): string {
|
||||
when there is something to show, so it doesn't push the members list down. */
|
||||
export function AbsenceNoticesCard() {
|
||||
const { groupId } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const locale = useIntlLocale()
|
||||
const query = useQuery({
|
||||
queryKey: ['absence-notices', groupId],
|
||||
queryFn: () => getGroupAbsenceNotices(groupId),
|
||||
@@ -31,7 +27,7 @@ export function AbsenceNoticesCard() {
|
||||
return (
|
||||
<section aria-labelledby="absence-notices-title" className="rounded-xl border border-border bg-surface">
|
||||
<h2 id="absence-notices-title" className="px-4 pt-4 text-sm font-semibold text-primary">
|
||||
Faltas avisadas · esta semana
|
||||
{t('absenceNotices.title')}
|
||||
</h2>
|
||||
<ul className="divide-y divide-border">
|
||||
{notices.map((notice) => (
|
||||
@@ -40,11 +36,11 @@ export function AbsenceNoticesCard() {
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="truncate text-sm font-medium text-primary">{notice.attendee.fullName}</p>
|
||||
<Badge variant="success">Justificada</Badge>
|
||||
<Badge variant="success">{t('absenceNotices.excused')}</Badge>
|
||||
</div>
|
||||
<p className="text-xs capitalize text-secondary">
|
||||
{classLabel(notice.startsAt)}
|
||||
{notice.reason ? ` · ${REASON_LABELS[notice.reason]}` : ''}
|
||||
{classLabel(notice.startsAt, locale)}
|
||||
{notice.reason ? ` · ${t(`absenceNotices.reason.${notice.reason}`)}` : ''}
|
||||
</p>
|
||||
{notice.message ? <p className="mt-1 text-sm text-primary">“{notice.message}”</p> : null}
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,10 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { Check, Copy, Loader2, TriangleAlert, Wallet } from 'lucide-react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Badge, Button, Input, Label, Modal } from '../../../components/ui'
|
||||
import { errorMessage } from '../../../i18n'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import { ApiError, createPaymentsBatch } from '../../../lib/api'
|
||||
import { formatPrice } from '../../../lib/format'
|
||||
import { mpStatusBadgeVariant, mpStatusLabel, useMpStatus } from '../../mp'
|
||||
@@ -23,7 +26,7 @@ function localDateValue(date: Date): string {
|
||||
}
|
||||
|
||||
function monthLabel(date: Date): string {
|
||||
return date.toLocaleDateString('es-MX', { month: 'long', year: 'numeric' })
|
||||
return date.toLocaleDateString(i18n.language, { month: 'long', year: 'numeric' })
|
||||
}
|
||||
|
||||
function defaultDueDate(): Date {
|
||||
@@ -38,11 +41,12 @@ type LinkRowProps = {
|
||||
}
|
||||
|
||||
function LinkRow({ item, copiedId, onCopy }: LinkRowProps) {
|
||||
const { t } = useTranslation('groupDetail')
|
||||
if (item.outcome !== 'LINKED' || !item.checkoutUrl) {
|
||||
return (
|
||||
<li className="flex items-center justify-between gap-3 rounded-lg bg-primary-soft px-3 py-2.5">
|
||||
<span className="min-w-0 truncate text-sm text-primary">{item.attendeeName}</span>
|
||||
<Badge variant="danger">No se generó</Badge>
|
||||
<Badge variant="danger">{t('charge.notGenerated')}</Badge>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
@@ -63,7 +67,7 @@ function LinkRow({ item, copiedId, onCopy }: LinkRowProps) {
|
||||
) : (
|
||||
<Copy className="size-3.5 text-accent" />
|
||||
)}
|
||||
{copied ? 'Copiado' : 'Copiar link'}
|
||||
{copied ? t('charge.copied') : t('charge.copyLink')}
|
||||
</Button>
|
||||
</li>
|
||||
)
|
||||
@@ -76,6 +80,7 @@ function LinkRow({ item, copiedId, onCopy }: LinkRowProps) {
|
||||
*/
|
||||
export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps) {
|
||||
const { group } = useGroupDetail()
|
||||
const { t } = useTranslation(['groupDetail', 'common'])
|
||||
const navigate = useNavigate()
|
||||
const queryClient = useQueryClient()
|
||||
const statusQuery = useMpStatus()
|
||||
@@ -107,19 +112,16 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
void queryClient.invalidateQueries({ queryKey: ['payments'] })
|
||||
},
|
||||
onError: (error: unknown) => {
|
||||
if (error instanceof ApiError) {
|
||||
setSubmissionError(
|
||||
error.problem?.code === 'mp_not_connected'
|
||||
? 'Tu cuenta de Mercado Pago no está vinculada.'
|
||||
: error.problem?.code === 'group_without_price'
|
||||
? 'Este grupo todavía no tiene precio.'
|
||||
: error.problem?.code === 'no_attendees_to_bill'
|
||||
? 'No hay miembros activos para cobrar.'
|
||||
: (error.problem?.detail ?? error.problem?.title ?? 'No pudimos crear los cobros.'),
|
||||
)
|
||||
} else {
|
||||
setSubmissionError('No pudimos crear los cobros.')
|
||||
}
|
||||
const code = error instanceof ApiError ? error.problem?.code : undefined
|
||||
setSubmissionError(
|
||||
code === 'mp_not_connected'
|
||||
? t('charge.mpNotConnected')
|
||||
: code === 'group_without_price'
|
||||
? t('charge.noPrice')
|
||||
: code === 'no_attendees_to_bill'
|
||||
? t('charge.noAttendees')
|
||||
: errorMessage(error, t('charge.error')),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -142,8 +144,8 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
<Modal
|
||||
isOpen={isOpen}
|
||||
onClose={onClose}
|
||||
title="Cobrar período"
|
||||
description={group?.name ? `Links de pago para ${group.name}` : undefined}
|
||||
title={t('charge.title')}
|
||||
description={group?.name ? t('charge.description', { group: group.name }) : undefined}
|
||||
maxWidth="md"
|
||||
>
|
||||
{!isConnected ? (
|
||||
@@ -151,21 +153,21 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
<Badge variant={mpStatusBadgeVariant(status)}>{mpStatusLabel(status)}</Badge>
|
||||
<p className="flex items-start gap-2 rounded-xl bg-warning-soft px-4 py-3 text-sm text-warning">
|
||||
<TriangleAlert className="mt-0.5 size-4 shrink-0" />
|
||||
Para crear links de pago primero vinculá tu cuenta de Mercado Pago.
|
||||
{t('charge.notConnected')}
|
||||
</p>
|
||||
<Button
|
||||
variant="primary"
|
||||
className="w-full"
|
||||
onClick={() => void navigate({ to: '/settings' })}
|
||||
>
|
||||
Conectar Mercado Pago
|
||||
{t('charge.connect')}
|
||||
</Button>
|
||||
</div>
|
||||
) : result ? (
|
||||
<div className="space-y-5">
|
||||
<p className="flex items-center gap-2 text-sm text-primary">
|
||||
<Wallet className="size-4 text-accent" />
|
||||
{result.linked} de {result.total} links creados
|
||||
{t('charge.created', { linked: result.linked, total: result.total })}
|
||||
</p>
|
||||
|
||||
<ul className="space-y-2">
|
||||
@@ -176,14 +178,13 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
|
||||
{result.failed > 0 ? (
|
||||
<p className="rounded-xl bg-primary-soft px-4 py-3 text-xs leading-relaxed text-foreground/70">
|
||||
Los que no se generaron quedaron guardados: vas a poder crearles el link desde
|
||||
Cobros sin cargarle nada al alumno.
|
||||
{t('charge.failedNote')}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
<div className="flex justify-end">
|
||||
<Button variant="primary" onClick={onClose}>
|
||||
Listo
|
||||
{t('charge.done')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -197,14 +198,14 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center justify-between rounded-xl bg-primary-soft px-4 py-3">
|
||||
<span className="text-sm text-foreground/70">Cuota del grupo</span>
|
||||
<span className="text-sm text-foreground/70">{t('charge.fee')}</span>
|
||||
<span className="text-sm font-semibold text-primary">{formatPrice(price)}</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<Label htmlFor="charge-due-date" className="mb-1.5 block">
|
||||
Vencimiento
|
||||
{t('charge.dueDate')}
|
||||
</Label>
|
||||
<Input
|
||||
id="charge-due-date"
|
||||
@@ -225,7 +226,7 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
|
||||
<div>
|
||||
<Label htmlFor="charge-description" className="mb-1.5 block">
|
||||
Período o concepto
|
||||
{t('charge.period')}
|
||||
</Label>
|
||||
<Input
|
||||
id="charge-description"
|
||||
@@ -233,7 +234,7 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
maxLength={120}
|
||||
value={description}
|
||||
onChange={(event) => setDescription(event.target.value)}
|
||||
placeholder="Ej.: Octubre 2026"
|
||||
placeholder={t('charge.periodPlaceholder')}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -246,7 +247,7 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
|
||||
<div className="flex items-center justify-end gap-3">
|
||||
<Button type="button" variant="ghost" onClick={onClose}>
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button type="submit" variant="primary" disabled={create.isPending}>
|
||||
{create.isPending ? (
|
||||
@@ -254,7 +255,7 @@ export function ChargeMembersModal({ isOpen, onClose }: ChargeMembersModalProps)
|
||||
) : (
|
||||
<Wallet className="size-4" />
|
||||
)}
|
||||
Crear links de pago
|
||||
{t('charge.submit')}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { GroupAutomationsDto } from '@gruperly/shared'
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { ChevronDown, MessageCircle } from 'lucide-react'
|
||||
import { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Badge, Switch } from '../../../components/ui'
|
||||
import { hasPlanFeature, useBillingStatus } from '../../billing'
|
||||
import { cn } from '../../../lib/utils'
|
||||
@@ -11,22 +12,23 @@ import { useGroupDetail } from './GroupDetailProvider'
|
||||
type Automation = {
|
||||
key: keyof GroupAutomationsDto
|
||||
kind: 'PAYMENT_REMINDER' | 'REENGAGEMENT'
|
||||
title: string
|
||||
description: string
|
||||
/** Keys in `groupDetail:automations`. */
|
||||
title: 'automations.paymentReminderTitle' | 'automations.reengagementTitle'
|
||||
description: 'automations.paymentReminderDescription' | 'automations.reengagementDescription'
|
||||
}
|
||||
|
||||
const AUTOMATIONS: readonly Automation[] = [
|
||||
{
|
||||
key: 'autoPaymentReminders',
|
||||
kind: 'PAYMENT_REMINDER',
|
||||
title: 'Recordatorio semanal de pago',
|
||||
description: 'A quien tenga un cobro pendiente o vencido, con su link de pago.',
|
||||
title: 'automations.paymentReminderTitle',
|
||||
description: 'automations.paymentReminderDescription',
|
||||
},
|
||||
{
|
||||
key: 'autoReengagement',
|
||||
kind: 'REENGAGEMENT',
|
||||
title: 'Mensaje de reenganche semanal',
|
||||
description: 'A los miembros en riesgo por faltas. Como mucho uno cada 2 semanas.',
|
||||
title: 'automations.reengagementTitle',
|
||||
description: 'automations.reengagementDescription',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -41,6 +43,7 @@ const AUTOMATIONS: readonly Automation[] = [
|
||||
*/
|
||||
export function GroupAutomationsCard() {
|
||||
const { group, updateAutomations, isUpdatingAutomations, isGroupOwner } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const whatsappQuery = useWhatsappStatus({ enabled: isGroupOwner })
|
||||
const billingQuery = useBillingStatus({ enabled: isGroupOwner })
|
||||
// `null` until the owner touches it: the default follows the data, which may
|
||||
@@ -51,7 +54,7 @@ export function GroupAutomationsCard() {
|
||||
const activeCount = AUTOMATIONS.filter((automation) => group[automation.key]).length
|
||||
const expanded = expandedByUser ?? activeCount > 0
|
||||
const summary =
|
||||
activeCount === 0 ? 'Apagados' : activeCount === 1 ? '1 activo' : `${activeCount} activos`
|
||||
activeCount === 0 ? t('automations.summaryOff') : t('automations.summary', { count: activeCount })
|
||||
|
||||
return (
|
||||
<section className="rounded-xl border border-border bg-surface">
|
||||
@@ -67,10 +70,10 @@ export function GroupAutomationsCard() {
|
||||
</span>
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className="flex items-center gap-2">
|
||||
<span className="text-sm font-semibold text-primary">Mensajes automáticos</span>
|
||||
<span className="text-sm font-semibold text-primary">{t('automations.title')}</span>
|
||||
{includedInPlan ? null : <Badge variant="info">Pro</Badge>}
|
||||
</span>
|
||||
<span className="block text-xs text-foreground/50">WhatsApp · {summary}</span>
|
||||
<span className="block text-xs text-foreground/50">{t('automations.channel', { summary })}</span>
|
||||
</span>
|
||||
<ChevronDown
|
||||
className={cn(
|
||||
@@ -88,9 +91,9 @@ export function GroupAutomationsCard() {
|
||||
{includedInPlan ? null : (
|
||||
<>
|
||||
{' '}
|
||||
Disponible en el plan Pro.{' '}
|
||||
{t('automations.proOnly')}{' '}
|
||||
<Link to="/billing" className="font-medium text-accent-fg underline">
|
||||
Ver planes
|
||||
{t('automations.seePlans')}
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
@@ -104,16 +107,16 @@ export function GroupAutomationsCard() {
|
||||
return (
|
||||
<li key={automation.key} className="flex items-start gap-3 px-4 py-3">
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-sm text-primary">{automation.title}</p>
|
||||
<p className="text-sm text-primary">{t(automation.title)}</p>
|
||||
<p id={hintId} className="text-xs text-foreground/50">
|
||||
{automation.description}
|
||||
{t(automation.description)}
|
||||
{blocked && !checked ? (
|
||||
<>
|
||||
{' '}
|
||||
<span className="text-warning">{blocked}</span>{' '}
|
||||
{whatsappQuery.data?.status !== 'active' ? (
|
||||
<Link to="/settings" className="font-medium text-accent-fg underline">
|
||||
Ir a Ajustes
|
||||
{t('automations.goToSettings')}
|
||||
</Link>
|
||||
) : null}
|
||||
</>
|
||||
@@ -125,7 +128,7 @@ export function GroupAutomationsCard() {
|
||||
disabled={
|
||||
isUpdatingAutomations || (!checked && (blocked !== null || !includedInPlan))
|
||||
}
|
||||
aria-label={automation.title}
|
||||
aria-label={t(automation.title)}
|
||||
aria-describedby={hintId}
|
||||
onCheckedChange={(next) => updateAutomations({ [automation.key]: next })}
|
||||
/>
|
||||
|
||||
@@ -11,7 +11,10 @@ import type {
|
||||
GroupWaitlistEntryDto,
|
||||
GroupRiskLevel,
|
||||
} from '@gruperly/shared'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useToast } from '../../../components/ui'
|
||||
import { errorMessage } from '../../../i18n'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import { useAuth } from '../../../context/AuthProvider'
|
||||
import {
|
||||
ApiError,
|
||||
@@ -108,6 +111,8 @@ export function GroupDetailProvider({
|
||||
}) {
|
||||
const queryClient = useQueryClient()
|
||||
const toast = useToast()
|
||||
// Subscribes the provider to the language: it builds copy (title, invite message).
|
||||
useTranslation()
|
||||
const { user } = useAuth()
|
||||
|
||||
const [isInviteModalOpen, setIsInviteModalOpen] = useState(false)
|
||||
@@ -189,10 +194,10 @@ export function GroupDetailProvider({
|
||||
mutationFn: () => getInviteToken(groupId, true),
|
||||
onSuccess: (data) => {
|
||||
queryClient.setQueryData(['invite-token', groupId], data)
|
||||
toast.success('Se generó un nuevo enlace de invitación.')
|
||||
toast.success(i18n.t('groupDetail:invite.regenerated'))
|
||||
},
|
||||
onError: () => {
|
||||
toast.error('No se pudo regenerar el enlace de invitación.')
|
||||
toast.error(i18n.t('groupDetail:invite.regenerateError'))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -202,10 +207,10 @@ export function GroupDetailProvider({
|
||||
queryClient.setQueryData<GroupDto>(['group', groupId], (current) =>
|
||||
current ? { ...current, ...automations } : current,
|
||||
)
|
||||
toast.success('Guardamos los mensajes automáticos del grupo.')
|
||||
toast.success(i18n.t('groupDetail:automations.saved'))
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
toast.error(err.message || 'No se pudieron guardar los mensajes automáticos.')
|
||||
toast.error(errorMessage(err, i18n.t('groupDetail:automations.saveError')))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -219,10 +224,10 @@ export function GroupDetailProvider({
|
||||
promoteGroupWaitlistEntry(groupId, entryId, targetGroupId),
|
||||
onSuccess: (result, { targetGroupId }) => {
|
||||
if (targetGroupId === groupId) {
|
||||
toast.success(`${result.attendee.fullName} pasó de la lista de espera al grupo.`)
|
||||
toast.success(i18n.t('groupDetail:waitlistEntry.promoted', { name: result.attendee.fullName }))
|
||||
} else {
|
||||
const targetName = groupsQuery.data?.data.find((g) => g.id === targetGroupId)?.name ?? 'otro grupo'
|
||||
toast.success(`${result.attendee.fullName} pasó a ${targetName}.`)
|
||||
const targetName = groupsQuery.data?.data.find((g) => g.id === targetGroupId)?.name ?? i18n.t('groupDetail:waitlistEntry.otherGroup')
|
||||
toast.success(i18n.t('groupDetail:waitlistEntry.promotedTo', { name: result.attendee.fullName, group: targetName }))
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-attendees', targetGroupId] })
|
||||
void queryClient.invalidateQueries({ queryKey: ['group', targetGroupId] })
|
||||
}
|
||||
@@ -231,9 +236,9 @@ export function GroupDetailProvider({
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
if (err instanceof ApiError && err.problem?.code === 'group_capacity_reached') {
|
||||
toast.error('El grupo alcanzó su cupo. Quita un miembro o aumenta el cupo primero.')
|
||||
toast.error(i18n.t('groupDetail:waitlistEntry.capacityReached'))
|
||||
} else {
|
||||
toast.error(err.message || 'No se pudo pasar al miembro al grupo.')
|
||||
toast.error(errorMessage(err, i18n.t('groupDetail:waitlistEntry.promoteError')))
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -241,11 +246,11 @@ export function GroupDetailProvider({
|
||||
const removeWaitlistEntryMutation = useMutation({
|
||||
mutationFn: (entry: GroupWaitlistEntryDto) => removeGroupWaitlistEntry(groupId, entry.id),
|
||||
onSuccess: (_result, entry) => {
|
||||
toast.success(`${entry.fullName} fue quitado de la lista de espera.`)
|
||||
toast.success(i18n.t('groupDetail:waitlistEntry.removed', { name: entry.fullName }))
|
||||
invalidateGroupQueries()
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
toast.error(err.message || 'No se pudo quitar de la lista de espera.')
|
||||
toast.error(errorMessage(err, i18n.t('groupDetail:waitlistEntry.removeError')))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -256,24 +261,24 @@ export function GroupDetailProvider({
|
||||
setSelectedPreRegistration(null)
|
||||
toast.success(
|
||||
result.outcome === 'added'
|
||||
? `${entry.fullName} ahora es miembro del grupo.`
|
||||
: `${entry.fullName} fue agregado a la lista de espera: el grupo está completo.`,
|
||||
? i18n.t('groupDetail:preRegistration.added', { name: entry.fullName })
|
||||
: i18n.t('groupDetail:preRegistration.waitlisted', { name: entry.fullName }),
|
||||
)
|
||||
invalidateGroupQueries()
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
if (err instanceof ApiError) {
|
||||
if (err.problem?.code === 'attendee_already_registered') {
|
||||
toast.error('Ya hay un miembro con ese teléfono en el grupo. Puedes rechazar la pre-inscripción.')
|
||||
toast.error(i18n.t('groupDetail:preRegistration.alreadyRegistered'))
|
||||
return
|
||||
}
|
||||
if (err.problem?.code === 'pre_registration_already_reviewed') {
|
||||
toast.error('Esta pre-inscripción ya fue revisada.')
|
||||
toast.error(i18n.t('groupDetail:preRegistration.alreadyReviewed'))
|
||||
invalidateGroupQueries()
|
||||
return
|
||||
}
|
||||
}
|
||||
toast.error(err.message || 'No se pudo aprobar la pre-inscripción.')
|
||||
toast.error(errorMessage(err, i18n.t('groupDetail:preRegistration.approveError')))
|
||||
},
|
||||
})
|
||||
|
||||
@@ -282,23 +287,23 @@ export function GroupDetailProvider({
|
||||
rejectGroupPreRegistration(groupId, entry.id),
|
||||
onSuccess: (_result, entry) => {
|
||||
setSelectedPreRegistration(null)
|
||||
toast.success(`La pre-inscripción de ${entry.fullName} fue rechazada.`)
|
||||
toast.success(i18n.t('groupDetail:preRegistration.rejected', { name: entry.fullName }))
|
||||
invalidateGroupQueries()
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
if (err instanceof ApiError && err.problem?.code === 'pre_registration_already_reviewed') {
|
||||
toast.error('Esta pre-inscripción ya fue revisada.')
|
||||
toast.error(i18n.t('groupDetail:preRegistration.alreadyReviewed'))
|
||||
invalidateGroupQueries()
|
||||
return
|
||||
}
|
||||
toast.error(err.message || 'No se pudo rechazar la pre-inscripción.')
|
||||
toast.error(errorMessage(err, i18n.t('groupDetail:preRegistration.rejectError')))
|
||||
},
|
||||
})
|
||||
|
||||
const inviteUrl = inviteTokenQuery.data?.inviteUrl
|
||||
const whatsappMessage =
|
||||
group && inviteUrl
|
||||
? `¡Hola! 👋 Te invito a unirte al grupo *${group.name}*.\n\nCompleta tu pre-inscripción en el siguiente enlace. El profesor revisará tu solicitud:\n${inviteUrl}`
|
||||
? i18n.t('groupDetail:invite.message', { group: group.name, url: inviteUrl })
|
||||
: ''
|
||||
const whatsappShareUrl = whatsappMessage
|
||||
? `https://wa.me/?text=${encodeURIComponent(whatsappMessage)}`
|
||||
@@ -308,9 +313,9 @@ export function GroupDetailProvider({
|
||||
if (!inviteUrl) return
|
||||
try {
|
||||
await navigator.clipboard.writeText(inviteUrl)
|
||||
toast.success('¡Enlace de invitación copiado al portapapeles!')
|
||||
toast.success(i18n.t('groupDetail:invite.linkCopied'))
|
||||
} catch {
|
||||
toast.error('No se pudo copiar automáticamente. Copia el texto manualmente.')
|
||||
toast.error(i18n.t('groupDetail:invite.copyError'))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,9 +323,9 @@ export function GroupDetailProvider({
|
||||
if (!whatsappMessage) return
|
||||
try {
|
||||
await navigator.clipboard.writeText(whatsappMessage)
|
||||
toast.success('¡Mensaje copiado al portapapeles!')
|
||||
toast.success(i18n.t('groupDetail:invite.messageCopied'))
|
||||
} catch {
|
||||
toast.error('No se pudo copiar automáticamente. Copia el texto manualmente.')
|
||||
toast.error(i18n.t('groupDetail:invite.copyError'))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,7 +334,7 @@ export function GroupDetailProvider({
|
||||
try {
|
||||
if (whatsappMessage) {
|
||||
await navigator.clipboard.writeText(whatsappMessage)
|
||||
toast.success('¡Abriendo WhatsApp! Mensaje copiado al portapapeles.')
|
||||
toast.success(i18n.t('groupDetail:invite.openingWhatsapp'))
|
||||
}
|
||||
} catch {
|
||||
// If the clipboard fails, we still open WhatsApp with the message.
|
||||
@@ -342,7 +347,7 @@ export function GroupDetailProvider({
|
||||
// the group detail page the name is already cached; on the first load it falls
|
||||
// back to "Grupo".
|
||||
const cachedGroupName = queryClient.getQueryData<GroupDto>(['group', groupId])?.name
|
||||
const groupTitle = group?.name ?? cachedGroupName ?? 'Grupo'
|
||||
const groupTitle = group?.name ?? cachedGroupName ?? i18n.t('groupDetail:fallbackTitle')
|
||||
|
||||
const value: GroupDetailContextValue = {
|
||||
groupId,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { Loader2 } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useState } from 'react'
|
||||
import { Button } from '../../../components/ui'
|
||||
import {
|
||||
@@ -33,6 +34,7 @@ export function GroupDetailView() {
|
||||
isGroupOwner,
|
||||
} = useGroupDetail()
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const [isChargeModalOpen, setIsChargeModalOpen] = useState(false)
|
||||
// El plan que cuenta es el del dueño: para un ADMIN no sabemos el suyo y
|
||||
// decide el backend (un 402 abre el mismo aviso).
|
||||
@@ -58,14 +60,14 @@ export function GroupDetailView() {
|
||||
</div>
|
||||
) : !group ? (
|
||||
<div className="rounded-xl border border-danger/20 bg-danger-soft p-6 text-danger">
|
||||
<h2 className="text-lg font-semibold">Grupo no encontrado</h2>
|
||||
<p className="mt-2 text-sm">No se pudo cargar la información de este grupo.</p>
|
||||
<h2 className="text-lg font-semibold">{t('notFound.title')}</h2>
|
||||
<p className="mt-2 text-sm">{t('notFound.description')}</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="mt-4"
|
||||
onClick={() => void navigate({ to: '/groups' })}
|
||||
>
|
||||
Volver a Grupos
|
||||
{t('notFound.back')}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Link, useNavigate } from '@tanstack/react-router'
|
||||
import { ArrowLeft, BarChart3, Share2, UserPlus, Wallet } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Badge, Button, Tooltip } from '../../../components/ui'
|
||||
import { LargeTitle } from '../../../components/layout/LargeTitle'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { RISK_HINT, RISK_LABELS } from '../constants'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
@@ -21,6 +21,7 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
waitlistPending,
|
||||
} = useGroupDetail()
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation(['groupDetail', 'groups'])
|
||||
const hasRisk = riskLevel === 'HIGH' || riskLevel === 'MEDIUM'
|
||||
|
||||
// Brand new group (no members, nothing pending): each tab's empty state
|
||||
@@ -45,7 +46,7 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
className="hidden shrink-0 items-center gap-1 text-sm text-foreground/80 transition-colors hover:text-primary lg:inline-flex"
|
||||
>
|
||||
<ArrowLeft className="size-4" />
|
||||
<span>Volver a grupos</span>
|
||||
<span>{t('header.backToGroups')}</span>
|
||||
</Link>
|
||||
}
|
||||
>
|
||||
@@ -55,13 +56,13 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
<div className="mt-3 flex flex-wrap items-center gap-2">
|
||||
<Badge variant="success" className="gap-1.5 text-[11px]">
|
||||
<span className="size-1.5 rounded-full bg-success" aria-hidden="true" />
|
||||
Activo
|
||||
{t('header.active')}
|
||||
</Badge>
|
||||
{hasRisk ? (
|
||||
// The badge cannot carry long text without cluttering the header:
|
||||
// the explanation (dropout risk, not collections risk) lives in the
|
||||
// tooltip.
|
||||
<Tooltip content={RISK_HINT}>
|
||||
<Tooltip content={t('groups:risk.hint')}>
|
||||
<Badge
|
||||
variant={riskLevel === 'HIGH' ? 'danger' : 'warning'}
|
||||
className="gap-1.5 text-[11px]"
|
||||
@@ -73,7 +74,7 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{RISK_LABELS[riskLevel]}
|
||||
{t(`groups:risk.${riskLevel}`)}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
@@ -109,7 +110,7 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
className="col-span-3 h-11 justify-center sm:w-auto"
|
||||
>
|
||||
<UserPlus className="size-4" />
|
||||
<span>Agregar miembro</span>
|
||||
<span>{t('header.addMember')}</span>
|
||||
</Button>
|
||||
) : null}
|
||||
<Button
|
||||
@@ -118,17 +119,17 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
className={SECONDARY_ACTION_CLASS_NAME}
|
||||
>
|
||||
<BarChart3 className="size-4 shrink-0 text-accent" />
|
||||
<span className="truncate">Estadísticas</span>
|
||||
<span className="truncate">{t('header.stats')}</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={onCharge}
|
||||
disabled={group?.price == null}
|
||||
title={group?.price == null ? 'Definí el precio del grupo para poder cobrar' : undefined}
|
||||
title={group?.price == null ? t('header.chargeNoPrice') : undefined}
|
||||
className={SECONDARY_ACTION_CLASS_NAME}
|
||||
>
|
||||
<Wallet className="size-4 shrink-0 text-accent" />
|
||||
<span className="truncate">Cobrar</span>
|
||||
<span className="truncate">{t('header.charge')}</span>
|
||||
</Button>
|
||||
{!isEmptyGroup ? (
|
||||
<Button
|
||||
@@ -137,7 +138,7 @@ export function GroupHeader({ onCharge }: { onCharge?: () => void }) {
|
||||
className={SECONDARY_ACTION_CLASS_NAME}
|
||||
>
|
||||
<Share2 className="size-4 shrink-0 text-accent" />
|
||||
<span className="truncate">Compartir</span>
|
||||
<span className="truncate">{t('header.share')}</span>
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { CalendarClock, CircleDollarSign, Users } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
formatBillingMeta,
|
||||
formatPrice,
|
||||
@@ -17,6 +18,7 @@ const CELL_CLASS = 'flex items-start gap-3 py-2.5 first:pt-0 last:pb-0 md:py-0'
|
||||
|
||||
export function GroupInfoCard() {
|
||||
const { group, attendeesTotal, attendeesPending, waitlistTotal } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
if (!group) return null
|
||||
|
||||
const daysLabel = sortWeekDays(group.days ?? []).map(weekDayLabel).join(', ')
|
||||
@@ -27,20 +29,20 @@ export function GroupInfoCard() {
|
||||
const billingMeta = formatBillingMeta(group.billingType, group.dueDay)
|
||||
|
||||
const capacityMeta = !capacity
|
||||
? 'Sin cupo definido'
|
||||
? t('info.noCapacity')
|
||||
: isFull
|
||||
? 'Cupo completo'
|
||||
: `${freeSpots} ${freeSpots === 1 ? 'lugar libre' : 'lugares libres'}`
|
||||
const waitlistMeta = waitlistTotal > 0 ? ` · ${waitlistTotal} en espera` : ''
|
||||
? t('info.full')
|
||||
: t('info.freeSpots', { count: freeSpots ?? 0 })
|
||||
const waitlistMeta = waitlistTotal > 0 ? t('info.waiting', { count: waitlistTotal }) : ''
|
||||
|
||||
return (
|
||||
<div className="divide-y divide-border/70 rounded-2xl bg-primary-soft p-3.5 sm:p-4 md:grid md:grid-cols-3 md:divide-x md:divide-y-0">
|
||||
<div className={cn(CELL_CLASS, 'md:pr-6')}>
|
||||
<CalendarClock className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={LABEL_CLASS}>Horario</p>
|
||||
<p className={LABEL_CLASS}>{t('info.schedule')}</p>
|
||||
<p className="mt-0.5 text-base font-semibold leading-snug text-primary">
|
||||
{daysLabel || 'Sin horario definido'}
|
||||
{daysLabel || t('info.noSchedule')}
|
||||
</p>
|
||||
{daysLabel && group.time ? (
|
||||
<p className="mt-0.5 text-sm tabular-nums text-foreground">{group.time}</p>
|
||||
@@ -51,7 +53,7 @@ export function GroupInfoCard() {
|
||||
<div className={cn(CELL_CLASS, 'md:px-6')}>
|
||||
<Users className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={LABEL_CLASS}>Miembros & Cupo</p>
|
||||
<p className={LABEL_CLASS}>{t('info.membersCapacity')}</p>
|
||||
<p className="mt-0.5 flex items-baseline text-2xl font-semibold leading-none tracking-tight tabular-nums text-primary">
|
||||
<span>{attendeesPending ? '—' : attendeesTotal}</span>
|
||||
{capacity ? (
|
||||
@@ -62,11 +64,11 @@ export function GroupInfoCard() {
|
||||
{capacity ? (
|
||||
<div
|
||||
role="progressbar"
|
||||
aria-label="Ocupación del cupo"
|
||||
aria-label={t('info.occupancy')}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={capacity}
|
||||
aria-valuenow={attendeesPending ? 0 : attendeesTotal}
|
||||
aria-valuetext={`${attendeesTotal} de ${capacity}`}
|
||||
aria-valuetext={t('info.occupancyValue', { count: attendeesTotal, capacity })}
|
||||
className="mt-1.5 h-1.5 w-full max-w-[9rem] overflow-hidden rounded-full bg-accent/15"
|
||||
>
|
||||
<div
|
||||
@@ -91,9 +93,9 @@ export function GroupInfoCard() {
|
||||
<div className={cn(CELL_CLASS, 'md:pl-6')}>
|
||||
<CircleDollarSign className="mt-0.5 size-5 shrink-0 text-accent" />
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className={LABEL_CLASS}>Cobro</p>
|
||||
<p className={LABEL_CLASS}>{t('info.billing')}</p>
|
||||
<p className="mt-0.5 text-base font-semibold tabular-nums text-primary">
|
||||
{group.price != null ? formatPrice(group.price) : 'Sin precio'}
|
||||
{group.price != null ? formatPrice(group.price) : t('info.noPrice')}
|
||||
</p>
|
||||
{billingMeta && group.price != null ? (
|
||||
<p className="mt-0.5 text-sm text-foreground">{billingMeta}</p>
|
||||
|
||||
@@ -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>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { AttendeeListItem, AttendanceStatus } from '@gruperly/shared'
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { Check } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { dotClass, statusLabel } from '../analytics/format'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -32,6 +33,7 @@ function PaymentLabel({ state }: { state: PaymentState }) {
|
||||
}
|
||||
|
||||
function AttendanceStrip({ recent }: { recent: AttendanceStatus[] }) {
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const summary = summarizeAttendance(recent)
|
||||
|
||||
if (summary.recorded === 0) {
|
||||
@@ -47,7 +49,7 @@ function AttendanceStrip({ recent }: { recent: AttendanceStatus[] }) {
|
||||
<span
|
||||
key={index}
|
||||
role="img"
|
||||
aria-label={`Clase ${index + 1} de ${summary.recorded}: ${statusLabel(status).toLowerCase()}`}
|
||||
aria-label={t('members.classDot', { index: index + 1, total: summary.recorded, status: statusLabel(status).toLowerCase() })}
|
||||
className={cn('size-2 rounded-full', dotClass(status))}
|
||||
/>
|
||||
))}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useNavigate } from '@tanstack/react-router'
|
||||
import { Loader2, Plus, Share2, Users, X } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -8,6 +9,7 @@ import { byFullName, isOverdue, resolvePaymentState } from './member-row'
|
||||
|
||||
function OverdueFilter({ count }: { count: number }) {
|
||||
const { overdueOnly, setOverdueOnly } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
return (
|
||||
<div className="px-3 pb-1.5">
|
||||
@@ -28,7 +30,7 @@ function OverdueFilter({ count }: { count: number }) {
|
||||
{/* The ✕ only shows with the filter on: it is the signal that tapping it
|
||||
takes the filter off, without having to say so. */}
|
||||
{overdueOnly ? <X className="size-3.5 shrink-0" aria-hidden="true" /> : null}
|
||||
<span className="whitespace-nowrap">{count} con pago vencido</span>
|
||||
<span className="whitespace-nowrap">{t('members.overdueFilter', { count })}</span>
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
@@ -44,6 +46,7 @@ export function MembersView() {
|
||||
openInviteModal,
|
||||
} = useGroupDetail()
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
const query = searchFilter.trim().toLowerCase()
|
||||
// The phone is not shown on the row but is still a search path: it is how most
|
||||
@@ -79,16 +82,15 @@ export function MembersView() {
|
||||
<div className="bg-surface px-4 py-10 text-center">
|
||||
<Users className="mx-auto mb-2 size-10 text-foreground/40" />
|
||||
<p className="text-sm font-semibold text-primary">
|
||||
Todavía no hay miembros en este grupo
|
||||
{t('members.emptyTitle')}
|
||||
</p>
|
||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||
Puedes compartir el enlace de invitación único o agregar miembros de forma manual o
|
||||
masiva.
|
||||
{t('members.emptyDescription')}
|
||||
</p>
|
||||
<div className="mt-4 flex flex-col gap-2.5 sm:flex-row sm:items-center sm:justify-center sm:gap-3">
|
||||
<Button variant="outline" onClick={openInviteModal} className="h-11 w-full sm:w-auto">
|
||||
<Share2 className="size-4" />
|
||||
Compartir enlace
|
||||
{t('members.shareLink')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -98,7 +100,7 @@ export function MembersView() {
|
||||
className="h-11 w-full sm:w-auto"
|
||||
>
|
||||
<Plus className="size-4" />
|
||||
Agregar miembros
|
||||
{t('members.addMembers')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -115,8 +117,8 @@ export function MembersView() {
|
||||
{filterBar}
|
||||
<div className="px-4 py-8 text-center text-sm text-foreground">
|
||||
{overdueOnly
|
||||
? 'Ningún miembro con pago vencido coincide con la búsqueda.'
|
||||
: 'No se encontraron miembros que coincidan con la búsqueda.'}
|
||||
? t('members.noOverdueMatch')
|
||||
: t('members.noMatch')}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Search } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Input } from '../../../components/ui'
|
||||
import { MEMBER_SEARCH_MIN } from './constants'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -8,6 +9,7 @@ import { SectionChips } from './SectionChips'
|
||||
|
||||
export function MembersWaitlistSection() {
|
||||
const { listSection, searchFilter, setSearchFilter, attendeesTotal } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
// With few attendees the search is noise: scrolling the list is enough. It is
|
||||
// removed from the tree instead of hidden, so as not to leave a gap in the
|
||||
@@ -39,10 +41,10 @@ export function MembersWaitlistSection() {
|
||||
<div className="relative w-full sm:w-72 lg:shrink-0">
|
||||
<Search className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-foreground/70" />
|
||||
<Input
|
||||
placeholder="Buscar por nombre o teléfono..."
|
||||
placeholder={t('sections.searchPlaceholder')}
|
||||
value={searchFilter}
|
||||
onChange={(e) => setSearchFilter(e.target.value)}
|
||||
aria-label="Buscar en el listado"
|
||||
aria-label={t('sections.searchLabel')}
|
||||
className="h-11 rounded-lg border-transparent pl-9 shadow-xs"
|
||||
/>
|
||||
</div>
|
||||
@@ -57,8 +59,7 @@ export function MembersWaitlistSection() {
|
||||
there; `pt-2` is the gap the row's `p-3` used to leave. */}
|
||||
{listSection === 'pending' ? (
|
||||
<p className="max-w-2xl px-3 pb-3 pt-2 text-xs leading-snug text-foreground/80">
|
||||
Pre-inscripciones que esperan tu aprobación y personas en lista de espera por un cupo
|
||||
libre.
|
||||
{t('sections.pendingHint')}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Clock, Inbox, Loader2, Share2, UserCheck } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button } from '../../../components/ui'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -14,6 +15,7 @@ export function PendingView() {
|
||||
searchFilter,
|
||||
openInviteModal,
|
||||
} = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
const query = searchFilter.trim().toLowerCase()
|
||||
const matches = (fullName: string, phone: string | null | undefined, email?: string | null) =>
|
||||
@@ -42,15 +44,14 @@ export function PendingView() {
|
||||
// `primary-soft` sinks the block; with the previous wash it camouflaged.
|
||||
<div className="bg-surface px-4 py-10 text-center">
|
||||
<Inbox className="mx-auto mb-2 size-10 text-foreground/40" />
|
||||
<p className="text-sm font-semibold text-primary">No hay pendientes</p>
|
||||
<p className="text-sm font-semibold text-primary">{t('pending.emptyTitle')}</p>
|
||||
<p className="mx-auto mt-1 max-w-sm text-sm text-foreground/80">
|
||||
Las pre-inscripciones que lleguen por el enlace compartido y las personas en lista de
|
||||
espera aparecerán aquí para que las revises.
|
||||
{t('pending.emptyDescription')}
|
||||
</p>
|
||||
<div className="mt-4 flex justify-center">
|
||||
<Button variant="primary" onClick={openInviteModal} className="h-11 w-full sm:w-auto">
|
||||
<Share2 className="size-4" />
|
||||
Compartir enlace
|
||||
{t('members.shareLink')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +61,7 @@ export function PendingView() {
|
||||
if (filteredPrereg.length === 0 && filteredWaitlist.length === 0) {
|
||||
return (
|
||||
<div className="py-8 text-center text-sm text-foreground/80">
|
||||
No se encontraron pendientes que coincidan con la búsqueda.
|
||||
{t('pending.noMatch')}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -68,20 +69,20 @@ export function PendingView() {
|
||||
const sections = [
|
||||
{
|
||||
key: 'preregistrations',
|
||||
title: 'Pre-inscripciones',
|
||||
title: t('pending.preRegistrations'),
|
||||
icon: UserCheck,
|
||||
attention: true,
|
||||
count: filteredPrereg.length,
|
||||
emptyNote: 'Sin pre-inscripciones pendientes.',
|
||||
emptyNote: t('pending.preRegistrationsEmpty'),
|
||||
table: <PreRegistrationsTable entries={filteredPrereg} />,
|
||||
},
|
||||
{
|
||||
key: 'waitlist',
|
||||
title: 'Lista de espera',
|
||||
title: t('pending.waitlist'),
|
||||
icon: Clock,
|
||||
attention: false,
|
||||
count: filteredWaitlist.length,
|
||||
emptyNote: 'Sin nadie en la lista de espera.',
|
||||
emptyNote: t('pending.waitlistEmpty'),
|
||||
table: <WaitlistTable entries={filteredWaitlist} />,
|
||||
},
|
||||
]
|
||||
@@ -91,7 +92,7 @@ export function PendingView() {
|
||||
{sections.map((section) => {
|
||||
const Icon = section.icon
|
||||
const hasRows = section.count > 0
|
||||
const titleId = `pending-${section.title.replace(/\s+/g, '-').toLowerCase()}`
|
||||
const titleId = `pending-${section.key}`
|
||||
// With the search on, sections with no matches are hidden.
|
||||
if (!hasRows && query) return null
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Ban, Loader2, Mail, MessageCircle, Phone, UserCheck } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { useIntlLocale } from '../../../i18n'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { DetailRow } from './DetailRow'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -14,12 +16,14 @@ export function PreRegistrationDetailModal() {
|
||||
isSubmittingApproval,
|
||||
isSubmittingRejection,
|
||||
} = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const locale = useIntlLocale()
|
||||
|
||||
return (
|
||||
<Modal
|
||||
isOpen={selectedPreRegistration !== null}
|
||||
onClose={() => setSelectedPreRegistration(null)}
|
||||
title="Detalle de la pre-inscripción"
|
||||
title={t('preRegistration.title')}
|
||||
maxWidth="sm"
|
||||
>
|
||||
{selectedPreRegistration ? (
|
||||
@@ -33,18 +37,19 @@ export function PreRegistrationDetailModal() {
|
||||
{selectedPreRegistration.fullName}
|
||||
</p>
|
||||
<p className="text-xs text-foreground/50">
|
||||
Solicitado el{' '}
|
||||
{new Date(selectedPreRegistration.createdAt).toLocaleDateString('es-ES', {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
{t('preRegistration.requestedOn', {
|
||||
date: new Date(selectedPreRegistration.createdAt).toLocaleDateString(locale, {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
}),
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1 divide-y divide-border rounded-xl border border-border bg-primary-soft/30">
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label="Teléfono">
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label={t('preRegistration.phone')}>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-primary">{formatPhoneDisplay(selectedPreRegistration.phone)}</span>
|
||||
<a
|
||||
@@ -60,7 +65,7 @@ export function PreRegistrationDetailModal() {
|
||||
</DetailRow>
|
||||
|
||||
{selectedPreRegistration.email ? (
|
||||
<DetailRow icon={<Mail className="size-4 text-accent" />} label="Email">
|
||||
<DetailRow icon={<Mail className="size-4 text-accent" />} label={t('preRegistration.email')}>
|
||||
<a
|
||||
href={`mailto:${selectedPreRegistration.email}`}
|
||||
className="text-primary transition-colors hover:text-accent"
|
||||
@@ -73,8 +78,7 @@ export function PreRegistrationDetailModal() {
|
||||
|
||||
{!hasFreeCapacity ? (
|
||||
<p className="rounded-xl border border-border bg-primary-soft/30 px-4 py-3 text-xs text-foreground/70">
|
||||
El grupo alcanzó su cupo de miembros. Si aprobás, esta persona quedará en la lista de
|
||||
espera hasta que se libere un lugar.
|
||||
{t('preRegistration.fullWarning')}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
@@ -90,7 +94,7 @@ export function PreRegistrationDetailModal() {
|
||||
) : (
|
||||
<UserCheck className="size-4" />
|
||||
)}
|
||||
<span>Aprobar</span>
|
||||
<span>{t('preRegistration.approve')}</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -103,7 +107,7 @@ export function PreRegistrationDetailModal() {
|
||||
) : (
|
||||
<Ban className="size-4" />
|
||||
)}
|
||||
Rechazar
|
||||
{t('preRegistration.reject')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import type { GroupPreRegistrationDto } from '@gruperly/shared'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useIntlLocale } from '../../../i18n'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrationDto[] }) {
|
||||
const { setSelectedPreRegistration } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const locale = useIntlLocale()
|
||||
|
||||
return (
|
||||
<table className="w-full table-fixed text-left text-sm">
|
||||
@@ -13,12 +17,12 @@ export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrati
|
||||
as `primary-soft`, the row's background, and the separator would
|
||||
disappear. */}
|
||||
<tr className="border-b border-foreground/10 text-xs font-semibold text-foreground/80">
|
||||
<th scope="col" className="w-[47%] px-3 pb-1.5">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-1.5">Teléfono</th>
|
||||
<th scope="col" className="w-[47%] px-3 pb-1.5">{t('table.name')}</th>
|
||||
<th scope="col" className="px-3 pb-1.5">{t('table.phone')}</th>
|
||||
{/* On mobile the phone leads: the date lives in the detail. */}
|
||||
<th scope="col" className="hidden px-3 pb-1.5 sm:table-cell">Solicitado</th>
|
||||
<th scope="col" className="hidden px-3 pb-1.5 sm:table-cell">{t('table.requested')}</th>
|
||||
<th scope="col" className="w-8 px-1 pb-1.5">
|
||||
<span className="sr-only">Detalle</span>
|
||||
<span className="sr-only">{t('table.detail')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -63,7 +67,7 @@ export function PreRegistrationsTable({ entries }: { entries: GroupPreRegistrati
|
||||
</span>
|
||||
</td>
|
||||
<td className="hidden min-w-0 px-3 py-2 text-xs text-foreground/70 sm:table-cell">
|
||||
{new Date(entry.createdAt).toLocaleDateString('es-ES', {
|
||||
{new Date(entry.createdAt).toLocaleDateString(locale, {
|
||||
day: 'numeric',
|
||||
month: 'short',
|
||||
})}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { AttendeeDto, GroupWaitlistEntryDto } from '@gruperly/shared'
|
||||
import { Clock, Loader2, Trash2, UserCheck, UserMinus } from 'lucide-react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
|
||||
@@ -24,22 +25,26 @@ export function RemoveAttendeeModal({
|
||||
onCancel,
|
||||
onConfirm,
|
||||
}: RemoveAttendeeModalProps) {
|
||||
const { t } = useTranslation(['groupDetail', 'common'])
|
||||
return (
|
||||
<Modal
|
||||
isOpen={attendee !== null}
|
||||
onClose={onCancel}
|
||||
title="Quitar del grupo"
|
||||
title={t('remove.title')}
|
||||
maxWidth="md"
|
||||
>
|
||||
{attendee ? (
|
||||
<div className="space-y-4">
|
||||
<p className="text-sm text-foreground/70">
|
||||
{attendee.fullName} dejará de ser miembro del grupo{' '}
|
||||
<strong className="text-primary">{groupName}</strong>
|
||||
{firstWaitlistEntry ? ' y el cupo quedará libre.' : '.'}
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey={firstWaitlistEntry ? 'remove.bodyFreeSpot' : 'remove.body'}
|
||||
values={{ name: attendee.fullName, group: groupName ?? '' }}
|
||||
components={{ strong: <strong className="text-primary" /> }}
|
||||
/>
|
||||
{attendee.phone ? (
|
||||
<span className="mt-1 block text-xs text-foreground/50">
|
||||
Teléfono: {formatPhoneDisplay(attendee.phone)}
|
||||
{t('remove.phone', { phone: formatPhoneDisplay(attendee.phone) })}
|
||||
</span>
|
||||
) : null}
|
||||
</p>
|
||||
@@ -52,13 +57,15 @@ export function RemoveAttendeeModal({
|
||||
<div className="space-y-3 rounded-xl border border-accent/20 bg-accent-soft p-4">
|
||||
<div className="flex items-center gap-2 text-xs font-semibold text-primary">
|
||||
<Clock className="size-4 text-accent" />
|
||||
<span>
|
||||
Hay {waitlistTotal} persona{waitlistTotal === 1 ? '' : 's'} esperando un cupo
|
||||
</span>
|
||||
<span>{t('remove.waiting', { count: waitlistTotal })}</span>
|
||||
</div>
|
||||
<p className="text-sm text-foreground/80">
|
||||
¿Quieres pasar a <strong className="text-primary">{firstWaitlistEntry.fullName}</strong>, el
|
||||
primero de la lista de espera, al grupo?
|
||||
<Trans
|
||||
t={t}
|
||||
i18nKey="remove.promoteQuestion"
|
||||
values={{ name: firstWaitlistEntry.fullName }}
|
||||
components={{ strong: <strong className="text-primary" /> }}
|
||||
/>
|
||||
</p>
|
||||
<div className="flex flex-col gap-2.5 pt-1">
|
||||
<Button
|
||||
@@ -72,7 +79,7 @@ export function RemoveAttendeeModal({
|
||||
) : (
|
||||
<UserCheck className="size-4" />
|
||||
)}
|
||||
<span>Quitar y pasar a {firstWaitlistEntry.fullName} al grupo</span>
|
||||
<span>{t('remove.removeAndPromote', { name: firstWaitlistEntry.fullName })}</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
@@ -85,14 +92,14 @@ export function RemoveAttendeeModal({
|
||||
) : (
|
||||
<UserMinus className="size-4" />
|
||||
)}
|
||||
<span>Solo quitar del grupo</span>
|
||||
<span>{t('remove.removeOnly')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center justify-end gap-2.5 border-t border-border pt-2">
|
||||
<Button variant="ghost" onClick={onCancel}>
|
||||
Cancelar
|
||||
{t('common:actions.cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -105,7 +112,7 @@ export function RemoveAttendeeModal({
|
||||
) : (
|
||||
<Trash2 className="size-4" />
|
||||
)}
|
||||
<span>Quitar del grupo</span>
|
||||
<span>{t('remove.confirm')}</span>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Inbox, Users } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { cn } from '../../../lib/utils'
|
||||
import { type ListSection, useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
const SECTIONS = [
|
||||
{ id: 'members', label: 'Miembros', icon: Users },
|
||||
{ id: 'pending', label: 'Pendientes', icon: Inbox },
|
||||
{ id: 'members', label: 'sections.members', icon: Users },
|
||||
{ id: 'pending', label: 'sections.pending', icon: Inbox },
|
||||
] as const satisfies ReadonlyArray<{
|
||||
id: ListSection
|
||||
label: string
|
||||
@@ -19,6 +20,7 @@ export function SectionChips() {
|
||||
preRegistrationsTotal,
|
||||
waitlistTotal,
|
||||
} = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
const counts: Record<ListSection, number> = {
|
||||
members: attendeesTotal,
|
||||
@@ -28,7 +30,7 @@ export function SectionChips() {
|
||||
return (
|
||||
<div
|
||||
role="group"
|
||||
aria-label="Listado del grupo"
|
||||
aria-label={t('sections.label')}
|
||||
className="flex w-full flex-wrap items-center gap-2"
|
||||
>
|
||||
{SECTIONS.map((section) => {
|
||||
@@ -56,7 +58,7 @@ export function SectionChips() {
|
||||
)}
|
||||
>
|
||||
<Icon className="size-3.5 shrink-0" />
|
||||
<span className="whitespace-nowrap">{section.label}</span>
|
||||
<span className="whitespace-nowrap">{t(section.label)}</span>
|
||||
{count > 0 ? (
|
||||
<span
|
||||
className={cn(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { GroupListItem } from '@gruperly/shared'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Loader2, Mail, MessageCircle, Phone, StickyNote, Trash2, UserCheck } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Button, Modal } from '../../../components/ui'
|
||||
import { useIntlLocale } from '../../../i18n'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { DetailRow } from './DetailRow'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
@@ -22,6 +24,8 @@ export function WaitlistEntryDetailModal() {
|
||||
isSubmittingPromotion,
|
||||
isSubmittingWaitlistRemoval,
|
||||
} = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
const locale = useIntlLocale()
|
||||
|
||||
// Por defecto pasa al grupo en el que se anotó; el profe puede elegir otro.
|
||||
const [targetGroupId, setTargetGroupId] = useState(groupId)
|
||||
@@ -37,7 +41,7 @@ export function WaitlistEntryDetailModal() {
|
||||
<Modal
|
||||
isOpen={selectedWaitlistEntry !== null}
|
||||
onClose={() => setSelectedWaitlistEntry(null)}
|
||||
title="Detalle de la lista de espera"
|
||||
title={t('waitlistEntry.title')}
|
||||
maxWidth="sm"
|
||||
>
|
||||
{selectedWaitlistEntry ? (
|
||||
@@ -49,18 +53,19 @@ export function WaitlistEntryDetailModal() {
|
||||
<div className="min-w-0">
|
||||
<p className="truncate text-lg font-semibold text-primary">{selectedWaitlistEntry.fullName}</p>
|
||||
<p className="text-xs text-foreground/50">
|
||||
En espera desde el{' '}
|
||||
{new Date(selectedWaitlistEntry.createdAt).toLocaleDateString('es-ES', {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
{t('waitlistEntry.since', {
|
||||
date: new Date(selectedWaitlistEntry.createdAt).toLocaleDateString(locale, {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
}),
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1 divide-y divide-border rounded-xl border border-border bg-primary-soft/30">
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label="Teléfono">
|
||||
<DetailRow icon={<Phone className="size-4 text-accent" />} label={t('waitlistEntry.phone')}>
|
||||
{selectedWaitlistEntry.phone ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-primary">{formatPhoneDisplay(selectedWaitlistEntry.phone)}</span>
|
||||
@@ -75,12 +80,12 @@ export function WaitlistEntryDetailModal() {
|
||||
</a>
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-foreground/40">Sin teléfono</span>
|
||||
<span className="text-foreground/40">{t('waitlistEntry.noPhone')}</span>
|
||||
)}
|
||||
</DetailRow>
|
||||
|
||||
{selectedWaitlistEntry.email ? (
|
||||
<DetailRow icon={<Mail className="size-4 text-accent" />} label="Email">
|
||||
<DetailRow icon={<Mail className="size-4 text-accent" />} label={t('waitlistEntry.email')}>
|
||||
<a
|
||||
href={`mailto:${selectedWaitlistEntry.email}`}
|
||||
className="text-primary transition-colors hover:text-accent"
|
||||
@@ -90,18 +95,18 @@ export function WaitlistEntryDetailModal() {
|
||||
</DetailRow>
|
||||
) : null}
|
||||
|
||||
<DetailRow icon={<StickyNote className="size-4 text-accent" />} label="Notas">
|
||||
<DetailRow icon={<StickyNote className="size-4 text-accent" />} label={t('waitlistEntry.notes')}>
|
||||
{selectedWaitlistEntry.notes ? (
|
||||
<span className="text-xs leading-relaxed text-primary">{selectedWaitlistEntry.notes}</span>
|
||||
) : (
|
||||
<span className="text-foreground/40">Sin notas</span>
|
||||
<span className="text-foreground/40">{t('waitlistEntry.noNotes')}</span>
|
||||
)}
|
||||
</DetailRow>
|
||||
</div>
|
||||
|
||||
{groups.length > 1 ? (
|
||||
<label className="block">
|
||||
<span className="mb-1.5 block text-sm font-medium text-primary">Asignar a</span>
|
||||
<span className="mb-1.5 block text-sm font-medium text-primary">{t('waitlistEntry.assignTo')}</span>
|
||||
<select
|
||||
value={targetGroupId}
|
||||
onChange={(event) => setTargetGroupId(event.target.value)}
|
||||
@@ -113,8 +118,11 @@ export function WaitlistEntryDetailModal() {
|
||||
const full = !isOwnGroup && isFull(group)
|
||||
return (
|
||||
<option key={group.id} value={group.id} disabled={full}>
|
||||
{group.name}
|
||||
{isOwnGroup ? ' (en el que se anotó)' : full ? ' (sin cupo)' : ''}
|
||||
{isOwnGroup
|
||||
? t('waitlistEntry.ownGroup', { name: group.name })
|
||||
: full
|
||||
? t('waitlistEntry.fullGroup', { name: group.name })
|
||||
: group.name}
|
||||
</option>
|
||||
)
|
||||
})}
|
||||
@@ -125,8 +133,8 @@ export function WaitlistEntryDetailModal() {
|
||||
{!targetHasFreeCapacity ? (
|
||||
<p className="rounded-xl border border-border bg-primary-soft/30 px-4 py-3 text-xs text-foreground/70">
|
||||
{isCurrentGroup
|
||||
? 'El grupo alcanzó su cupo de miembros. Quita un miembro o aumenta el cupo para poder pasar a esta persona al grupo.'
|
||||
: 'Ese grupo alcanzó su cupo de miembros. Elige otro grupo o libera un lugar primero.'}
|
||||
? t('waitlistEntry.currentFull')
|
||||
: t('waitlistEntry.targetFull')}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
@@ -143,7 +151,7 @@ export function WaitlistEntryDetailModal() {
|
||||
<UserCheck className="size-4" />
|
||||
)}
|
||||
<span className="truncate">
|
||||
{isCurrentGroup || !targetGroup ? 'Pasar al grupo' : `Pasar a ${targetGroup.name}`}
|
||||
{isCurrentGroup || !targetGroup ? t('waitlistEntry.promote') : t('waitlistEntry.promoteTo', { group: targetGroup.name })}
|
||||
</span>
|
||||
</Button>
|
||||
<Button
|
||||
@@ -153,7 +161,7 @@ export function WaitlistEntryDetailModal() {
|
||||
className="gap-2 border border-danger/20 text-danger hover:bg-danger/10 hover:text-danger"
|
||||
>
|
||||
<Trash2 className="size-4" />
|
||||
Quitar de la lista de espera
|
||||
{t('waitlistEntry.remove')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import type { GroupWaitlistEntryDto } from '@gruperly/shared'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { formatPhoneDisplay } from '../../../lib/format'
|
||||
import { useGroupDetail } from './GroupDetailProvider'
|
||||
|
||||
export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] }) {
|
||||
const { setSelectedWaitlistEntry } = useGroupDetail()
|
||||
const { t } = useTranslation('groupDetail')
|
||||
|
||||
return (
|
||||
<table className="w-full table-fixed text-left text-sm">
|
||||
@@ -13,10 +15,10 @@ export function WaitlistTable({ entries }: { entries: GroupWaitlistEntryDto[] })
|
||||
as `primary-soft`, the row's background, and the separator would
|
||||
disappear. */}
|
||||
<tr className="border-b border-foreground/10 text-xs font-semibold text-foreground/80">
|
||||
<th scope="col" className="w-[47%] px-3 pb-1.5">Nombre</th>
|
||||
<th scope="col" className="px-3 pb-1.5">Teléfono</th>
|
||||
<th scope="col" className="w-[47%] px-3 pb-1.5">{t('table.name')}</th>
|
||||
<th scope="col" className="px-3 pb-1.5">{t('table.phone')}</th>
|
||||
<th scope="col" className="w-8 px-1 pb-1.5">
|
||||
<span className="sr-only">Detalle</span>
|
||||
<span className="sr-only">{t('table.detail')}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { AttendeeListItem, AttendanceStatus } from '@gruperly/shared'
|
||||
import { RECENT_ATTENDANCE_LIMIT } from '@gruperly/shared'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import { PAYMENT_DUE_SOON_DAYS } from './constants'
|
||||
|
||||
/* The listing's row does not ask the backend for presentation verdicts: it asks
|
||||
@@ -56,14 +57,14 @@ export function isOverdue(state: PaymentState | null): boolean {
|
||||
export function paymentStateLabel(state: PaymentState): string {
|
||||
switch (state.kind) {
|
||||
case 'settled':
|
||||
return 'Al día'
|
||||
return i18n.t('groupDetail:row.settled')
|
||||
case 'dueSoon':
|
||||
// "Vence en 0 d" is not natural Spanish: today and tomorrow have words.
|
||||
if (state.days === 0) return 'Vence hoy'
|
||||
if (state.days === 1) return 'Vence mañana'
|
||||
return `Vence en ${state.days} d`
|
||||
// "Vence en 0 d" is not natural: today and tomorrow have words.
|
||||
if (state.days === 0) return i18n.t('groupDetail:row.dueToday')
|
||||
if (state.days === 1) return i18n.t('groupDetail:row.dueTomorrow')
|
||||
return i18n.t('groupDetail:row.dueIn', { days: state.days })
|
||||
case 'overdue':
|
||||
return `Vencido · ${state.days} d`
|
||||
return i18n.t('groupDetail:row.overdue', { days: state.days })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +87,7 @@ export function summarizeAttendance(
|
||||
const recorded = dots.length
|
||||
|
||||
if (recorded === 0) {
|
||||
return { dots, attended: 0, recorded: 0, label: 'Sin clases aún' }
|
||||
return { dots, attended: 0, recorded: 0, label: i18n.t('groupDetail:row.noClasses') }
|
||||
}
|
||||
|
||||
const attended = dots.filter((status) => status === 'PRESENT').length
|
||||
@@ -94,7 +95,7 @@ export function summarizeAttendance(
|
||||
dots,
|
||||
attended,
|
||||
recorded,
|
||||
label: `${attended} de ${recorded} ${recorded === 1 ? 'clase' : 'clases'}`,
|
||||
label: i18n.t('groupDetail:row.attended', { attended, count: recorded }),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import type { AttendeeDto, RemoveAttendeeResult } from '@gruperly/shared'
|
||||
import { useToast } from '../../../components/ui'
|
||||
import { ApiError, removeGroupAttendee } from '../../../lib/api'
|
||||
import { errorMessage } from '../../../i18n'
|
||||
import { i18n } from '../../../i18n/instance'
|
||||
import { removeGroupAttendee } from '../../../lib/api'
|
||||
|
||||
type RemoveAttendeePayload = {
|
||||
attendee: AttendeeDto
|
||||
@@ -23,10 +25,13 @@ export function useRemoveAttendee({ groupId, onRemoved }: UseRemoveAttendeeOptio
|
||||
onSuccess: (result, { attendee }) => {
|
||||
if (result.promoted) {
|
||||
toast.success(
|
||||
`${attendee.fullName} fue quitado del grupo y ${result.promoted.fullName} pasó de la lista de espera al grupo.`,
|
||||
i18n.t('groupDetail:remove.removedPromoted', {
|
||||
name: attendee.fullName,
|
||||
promoted: result.promoted.fullName,
|
||||
}),
|
||||
)
|
||||
} else {
|
||||
toast.success(`${attendee.fullName} fue quitado del grupo.`)
|
||||
toast.success(i18n.t('groupDetail:remove.removed', { name: attendee.fullName }))
|
||||
}
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-attendees', groupId] })
|
||||
void queryClient.invalidateQueries({ queryKey: ['group-waitlist', groupId] })
|
||||
@@ -34,11 +39,8 @@ export function useRemoveAttendee({ groupId, onRemoved }: UseRemoveAttendeeOptio
|
||||
onRemoved?.(result)
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
if (err instanceof ApiError && err.problem?.code === 'attendee_has_payments') {
|
||||
toast.error(err.problem.detail ?? 'Este miembro tiene cobros asociados.')
|
||||
} else {
|
||||
toast.error(err.message || 'Error al quitar al miembro del grupo.')
|
||||
}
|
||||
// `attendee_has_payments` comes translated by its code.
|
||||
toast.error(errorMessage(err, i18n.t('groupDetail:remove.error')))
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -12,17 +12,5 @@ export const WEEK_DAYS: readonly WeekDay[] = [
|
||||
'SUNDAY',
|
||||
]
|
||||
|
||||
export const WEEK_DAY_CHIPS: readonly { value: WeekDay; label: string }[] = [
|
||||
{ value: 'MONDAY', label: 'Lun' },
|
||||
{ value: 'TUESDAY', label: 'Mar' },
|
||||
{ value: 'WEDNESDAY', label: 'Mié' },
|
||||
{ value: 'THURSDAY', label: 'Jue' },
|
||||
{ value: 'FRIDAY', label: 'Vie' },
|
||||
{ value: 'SATURDAY', label: 'Sáb' },
|
||||
{ value: 'SUNDAY', label: 'Dom' },
|
||||
]
|
||||
|
||||
export const BILLING_TYPES: readonly { value: BillingType; label: string; hint: string }[] = [
|
||||
{ value: 'MONTHLY', label: 'Mensual', hint: 'Un cobro por mes' },
|
||||
{ value: 'PER_CLASS', label: 'Por clase', hint: 'Cada clase que asista' },
|
||||
]
|
||||
// Labels: `common:weekDayShort.*`, `common:billingType.*` and `common:billingTypeHint.*`.
|
||||
export const BILLING_TYPES: readonly BillingType[] = ['MONTHLY', 'PER_CLASS']
|
||||
8
apps/web/src/i18n/i18next.d.ts
vendored
8
apps/web/src/i18n/i18next.d.ts
vendored
@@ -6,6 +6,10 @@ import type layout from './locales/es-AR/layout.json'
|
||||
import type pwa from './locales/es-AR/pwa.json'
|
||||
import type settings from './locales/es-AR/settings.json'
|
||||
import type home from './locales/es-AR/home.json'
|
||||
import type groups from './locales/es-AR/groups.json'
|
||||
import type groupDetail from './locales/es-AR/groupDetail.json'
|
||||
import type groupAdd from './locales/es-AR/groupAdd.json'
|
||||
import type analytics from './locales/es-AR/analytics.json'
|
||||
import type validation from './locales/es-AR/validation.json'
|
||||
|
||||
// es-AR es la fuente: una clave que no exista ahí rompe el typecheck.
|
||||
@@ -20,6 +24,10 @@ declare module 'i18next' {
|
||||
pwa: typeof pwa
|
||||
settings: typeof settings
|
||||
validation: typeof validation
|
||||
'analytics': typeof analytics
|
||||
'groupAdd': typeof groupAdd
|
||||
'groupDetail': typeof groupDetail
|
||||
'groups': typeof groups
|
||||
'home': typeof home
|
||||
}
|
||||
}
|
||||
|
||||
56
apps/web/src/i18n/locales/en/analytics.json
Normal file
56
apps/web/src/i18n/locales/en/analytics.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"back": "Back to group",
|
||||
"subtitle": "Stats",
|
||||
"description": "Attendance and risk management",
|
||||
"period": "Last 30 days",
|
||||
"loadError": {
|
||||
"title": "We couldn't load the stats",
|
||||
"description": "Check your connection and try again."
|
||||
},
|
||||
"kpi": {
|
||||
"attendanceRate": "Average attendance",
|
||||
"attendanceRateHint": "last 30 days",
|
||||
"present": "Attendances this month",
|
||||
"presentHint_one": "{{count}} class held",
|
||||
"presentHint_other": "{{count}} classes held",
|
||||
"recovered": "Spots recovered",
|
||||
"recoveredHint": "from absence notices"
|
||||
},
|
||||
"atRisk": {
|
||||
"title": "Students at risk",
|
||||
"count_one": "{{count}} student",
|
||||
"count_other": "{{count}} students",
|
||||
"description": "Students with consecutive absences, who stopped coming, or whose attendance is dropping.",
|
||||
"emptyTitle": "No students at risk!",
|
||||
"emptyDescription": "No consecutive absences and no attendance below 50%.",
|
||||
"noPhone": "No phone",
|
||||
"monthlyRate": "{{rate}}% monthly attendance",
|
||||
"reengage": "Reach out on WhatsApp",
|
||||
"manage": "Manage spot",
|
||||
"pause": "Pause spot",
|
||||
"drop": "Remove",
|
||||
"reasonStreak": "{{count}} absences in a row",
|
||||
"reasonDays_one": "{{count}} day away",
|
||||
"reasonDays_other": "{{count}} days away",
|
||||
"reasonTrend": "Attendance dropping",
|
||||
"reengageMessage": "Hi {{name}}! 👋 We miss you at {{group}}. We noticed you missed the last few classes and we'd love to have you back. If something's wrong with your schedule or membership, message us and we'll sort it out together.",
|
||||
"yourClass": "your class",
|
||||
"openingWhatsapp": "Opening WhatsApp! Message copied to clipboard."
|
||||
},
|
||||
"status": {
|
||||
"dropTitle": "Remove from group",
|
||||
"pauseTitle": "Pause spot",
|
||||
"dropBody": "{{name}} will stop attending <strong>{{group}}</strong>. Their spot will be <strong>available</strong> for another student, and their attendance history is kept.",
|
||||
"pauseBody": "{{name}} will be <strong>paused</strong> in <strong>{{group}}</strong>. Their spot becomes <strong>free</strong> and you can reactivate it anytime.",
|
||||
"dropped": "{{name}} was removed from the group. Their spot is now available.",
|
||||
"paused": "{{name}}'s spot was paused.",
|
||||
"error": "We couldn't update the student's status."
|
||||
},
|
||||
"history": {
|
||||
"title": "History",
|
||||
"description": "Attendance history for the last classes.",
|
||||
"error": "We couldn't load this student's history.",
|
||||
"overall_one": "Overall attendance ({{count}} class)",
|
||||
"overall_other": "Overall attendance ({{count}} classes)"
|
||||
}
|
||||
}
|
||||
@@ -38,5 +38,24 @@
|
||||
"tomorrow": "Tomorrow · {{time}}",
|
||||
"other": "{{date}} · {{time}}"
|
||||
},
|
||||
"billingDueDay": "Due on day {{day}} of each month"
|
||||
"billingDueDay": "Due on day {{day}} of each month",
|
||||
"weekDayShort": {
|
||||
"MONDAY": "Mon",
|
||||
"TUESDAY": "Tue",
|
||||
"WEDNESDAY": "Wed",
|
||||
"THURSDAY": "Thu",
|
||||
"FRIDAY": "Fri",
|
||||
"SATURDAY": "Sat",
|
||||
"SUNDAY": "Sun"
|
||||
},
|
||||
"billingTypeHint": {
|
||||
"MONTHLY": "One charge per month",
|
||||
"PER_CLASS": "Each class attended"
|
||||
},
|
||||
"attendanceStatus": {
|
||||
"PRESENT": "Present",
|
||||
"ABSENT": "Absent",
|
||||
"EXCUSED": "Gave notice",
|
||||
"NONE": "Not recorded"
|
||||
}
|
||||
}
|
||||
|
||||
97
apps/web/src/i18n/locales/en/groupAdd.json
Normal file
97
apps/web/src/i18n/locales/en/groupAdd.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"back": "Back to group",
|
||||
"title": "Add members",
|
||||
"subtitleGroup": "Add members to <strong>{{group}}</strong> one by one or in bulk from a list.",
|
||||
"subtitle": "Add members one by one or in bulk from a list.",
|
||||
"occupancy": "{{count}} of {{capacity}} spots taken.",
|
||||
"tabs": {
|
||||
"quick": "Quick add (one by one)",
|
||||
"bulk": "Bulk import (CSV / Excel)"
|
||||
},
|
||||
"quick": {
|
||||
"firstName": "First name",
|
||||
"firstNamePlaceholder": "E.g. Lucas",
|
||||
"lastName": "Last name",
|
||||
"lastNamePlaceholder": "E.g. Smith",
|
||||
"phone": "Phone / WhatsApp",
|
||||
"phonePlaceholder": "E.g. +1 555 123 4567",
|
||||
"phoneHint": "Used to contact them and spot duplicates.",
|
||||
"email": "Email (optional)",
|
||||
"emailPlaceholder": "student@example.com",
|
||||
"notes": "Notes (optional)",
|
||||
"notesPlaceholder": "E.g. Intermediate level, brings own gear",
|
||||
"submit": "Save member",
|
||||
"mustLink": "That phone already belongs to someone you've registered: add them or use another phone.",
|
||||
"required": "Name and phone are required."
|
||||
},
|
||||
"existing": {
|
||||
"alreadyInGroup": "{{name}} is already a member of this group.",
|
||||
"linked": "You're adding <strong>{{name}}</strong> to this group. Their contact details and notes are the same as in their other groups.",
|
||||
"found": "You already have <strong>{{name}}</strong> with this phone. Is it the same person?",
|
||||
"foundInGroups": "You already have <strong>{{name}}</strong> with this phone (in {{groups}}). Is it the same person?",
|
||||
"notThisPerson": "Not this person",
|
||||
"otherPhone": "Use another phone",
|
||||
"confirm": "Yes, add them"
|
||||
},
|
||||
"capacity": {
|
||||
"title": "Group is full",
|
||||
"description": "The group has reached its maximum capacity.",
|
||||
"body": "<strong>{{group}}</strong> already has its maximum of <strong>{{capacity}}</strong> members. What do you want to do with <strong>{{name}}</strong>?",
|
||||
"force": "Add anyway",
|
||||
"waitlist": "Add to waitlist",
|
||||
"forceHint": "If you add them anyway, the group will go over its capacity."
|
||||
},
|
||||
"bulkCapacity": {
|
||||
"title": "Capacity warning",
|
||||
"description": "The import goes over the group's capacity.",
|
||||
"body": "You're about to import <strong>{{rows}}</strong> member(s), but the group already has <strong>{{current}}</strong> enrolled and its capacity is <strong>{{capacity}}</strong>. Import them anyway?",
|
||||
"confirm": "Import anyway"
|
||||
},
|
||||
"bulk": {
|
||||
"unsupported": "Unsupported format. Upload a .csv or .xlsx file",
|
||||
"noContacts": "No contacts were found in the file.",
|
||||
"detected": "Found {{count}} rows ({{valid}} valid).",
|
||||
"processError": "There was an error processing the file.",
|
||||
"dropzone": "Drag your file here or tap to choose it",
|
||||
"formats": "Formats: CSV (.csv) or Excel (.xlsx)",
|
||||
"templateHint": "Don't have a file ready? Use our template.",
|
||||
"downloadTemplate": "Download CSV template",
|
||||
"parsing": "Reading and analyzing the file...",
|
||||
"preview": "Preview:",
|
||||
"ready": "{{count}} ready to import",
|
||||
"withErrors": "{{count}} with errors",
|
||||
"clear": "Clear list",
|
||||
"name": "Name",
|
||||
"phone": "Phone",
|
||||
"email": "Email",
|
||||
"status": "Status",
|
||||
"noName": "No name",
|
||||
"noPhone": "No phone",
|
||||
"valid": "Valid",
|
||||
"removeRow": "Remove row",
|
||||
"confirm": "Confirm and import ({{count}})",
|
||||
"missingName": "Name missing",
|
||||
"invalidPhone": "Invalid or missing phone",
|
||||
"noSheet": "We couldn't find the main sheet in the Excel file.",
|
||||
"noValidRows": "There are no valid members to import."
|
||||
},
|
||||
"template": {
|
||||
"fileName": "gruperly_students_template.csv",
|
||||
"header": "First name,Last name,Phone,Email,Notes",
|
||||
"rows": "Sophia,Rodriguez,+15551234567,sophia@example.com,Intermediate level\nLucas,Smith,+15552345678,lucas@example.com,Brings own instrument\nValentina,Morales,+15553456789,,"
|
||||
},
|
||||
"toast": {
|
||||
"created": "{{name}} was added to the group.",
|
||||
"waitlisted": "{{name}} was added to the group's waitlist.",
|
||||
"personExists": "You already have someone registered with this phone. You can add them to this group.",
|
||||
"addError": "We couldn't add the member.",
|
||||
"alreadyWaitlisted": "This number is already on the group's waitlist.",
|
||||
"waitlistError": "We couldn't add them to the waitlist.",
|
||||
"importError": "We couldn't import the members.",
|
||||
"imported_one": "{{count}} student added.",
|
||||
"imported_other": "{{count}} students added.",
|
||||
"importedLinked": "{{count}} were already in your other groups.",
|
||||
"importedDuplicates_one": "{{count}} duplicate skipped.",
|
||||
"importedDuplicates_other": "{{count}} duplicates skipped."
|
||||
}
|
||||
}
|
||||
199
apps/web/src/i18n/locales/en/groupDetail.json
Normal file
199
apps/web/src/i18n/locales/en/groupDetail.json
Normal file
@@ -0,0 +1,199 @@
|
||||
{
|
||||
"fallbackTitle": "Group",
|
||||
"header": {
|
||||
"backToGroups": "Back to groups",
|
||||
"active": "Active",
|
||||
"addMember": "Add member",
|
||||
"stats": "Stats",
|
||||
"charge": "Charge",
|
||||
"chargeNoPrice": "Set the group's price to start charging",
|
||||
"share": "Share"
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Group not found",
|
||||
"description": "We couldn't load this group's information.",
|
||||
"back": "Back to Groups"
|
||||
},
|
||||
"info": {
|
||||
"schedule": "Schedule",
|
||||
"noSchedule": "No schedule set",
|
||||
"membersCapacity": "Members & capacity",
|
||||
"occupancy": "Capacity used",
|
||||
"occupancyValue": "{{count}} of {{capacity}}",
|
||||
"noCapacity": "No capacity set",
|
||||
"full": "Full",
|
||||
"freeSpots_one": "{{count}} spot left",
|
||||
"freeSpots_other": "{{count}} spots left",
|
||||
"waiting": " · {{count}} waiting",
|
||||
"billing": "Billing",
|
||||
"noPrice": "No price"
|
||||
},
|
||||
"sections": {
|
||||
"label": "Group list",
|
||||
"members": "Members",
|
||||
"pending": "Pending",
|
||||
"searchPlaceholder": "Search by name or phone...",
|
||||
"searchLabel": "Search the list",
|
||||
"pendingHint": "Pre-registrations waiting for your approval and people on the waitlist for an open spot."
|
||||
},
|
||||
"members": {
|
||||
"overdueFilter": "{{count}} with an overdue payment",
|
||||
"emptyTitle": "No members in this group yet",
|
||||
"emptyDescription": "Share the invite link or add members one by one or in bulk.",
|
||||
"shareLink": "Share link",
|
||||
"addMembers": "Add members",
|
||||
"noOverdueMatch": "No member with an overdue payment matches your search.",
|
||||
"noMatch": "No members match your search.",
|
||||
"classDot": "Class {{index}} of {{total}}: {{status}}"
|
||||
},
|
||||
"row": {
|
||||
"settled": "Up to date",
|
||||
"dueToday": "Due today",
|
||||
"dueTomorrow": "Due tomorrow",
|
||||
"dueIn": "Due in {{days}} d",
|
||||
"overdue": "Overdue · {{days}} d",
|
||||
"noClasses": "No classes yet",
|
||||
"attended_one": "{{attended}} of {{count}} class",
|
||||
"attended_other": "{{attended}} of {{count}} classes"
|
||||
},
|
||||
"pending": {
|
||||
"emptyTitle": "Nothing pending",
|
||||
"emptyDescription": "Pre-registrations from the shared link and people on the waitlist will show up here for you to review.",
|
||||
"noMatch": "Nothing pending matches your search.",
|
||||
"preRegistrations": "Pre-registrations",
|
||||
"preRegistrationsEmpty": "No pending pre-registrations.",
|
||||
"waitlist": "Waitlist",
|
||||
"waitlistEmpty": "No one on the waitlist."
|
||||
},
|
||||
"table": {
|
||||
"name": "Name",
|
||||
"phone": "Phone",
|
||||
"requested": "Requested",
|
||||
"detail": "Details"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Share invite link",
|
||||
"description": "Send this link to your members so they can fill in their details and pre-register for the group.",
|
||||
"linkLabel": "Group's unique link",
|
||||
"copy": "Copy",
|
||||
"copyTitle": "Copy to clipboard",
|
||||
"previewTitle": "WhatsApp message preview:",
|
||||
"copyMessage": "Copy message",
|
||||
"copyMessageTitle": "Copy the full message to the clipboard",
|
||||
"message": "Hi! 👋 I'd like to invite you to join *{{group}}*.\n\nPre-register using this link. Your teacher will review your request:\n{{url}}",
|
||||
"messagePreview": "Hi! 👋 I'd like to invite you to join <strong>{{group}}</strong>.\n\nPre-register using this link. Your teacher will review your request:\n",
|
||||
"openWhatsapp": "Open in WhatsApp",
|
||||
"regenerate": "Reset link",
|
||||
"regenerateTitle": "Invalidates the old link and creates a new one",
|
||||
"footnote": "When you tap <strong>Open in WhatsApp</strong>, the full message is copied to your clipboard. If WhatsApp Web only loads the link, paste it with <kbd>Ctrl+V</kbd> or <kbd>Cmd+V</kbd>.",
|
||||
"regenerated": "A new invite link was created.",
|
||||
"regenerateError": "We couldn't reset the invite link.",
|
||||
"linkCopied": "Invite link copied to clipboard!",
|
||||
"messageCopied": "Message copied to clipboard!",
|
||||
"copyError": "We couldn't copy automatically. Copy the text manually.",
|
||||
"openingWhatsapp": "Opening WhatsApp! Message copied to clipboard."
|
||||
},
|
||||
"remove": {
|
||||
"title": "Remove from group",
|
||||
"body": "{{name}} will no longer be a member of <strong>{{group}}</strong>.",
|
||||
"bodyFreeSpot": "{{name}} will no longer be a member of <strong>{{group}}</strong> and the spot will open up.",
|
||||
"phone": "Phone: {{phone}}",
|
||||
"waiting_one": "{{count}} person is waiting for a spot",
|
||||
"waiting_other": "{{count}} people are waiting for a spot",
|
||||
"promoteQuestion": "Move <strong>{{name}}</strong>, first on the waitlist, into the group?",
|
||||
"removeAndPromote": "Remove and move {{name}} into the group",
|
||||
"removeOnly": "Just remove from the group",
|
||||
"confirm": "Remove from group",
|
||||
"removed": "{{name}} was removed from the group.",
|
||||
"removedPromoted": "{{name}} was removed from the group and {{promoted}} moved from the waitlist into the group.",
|
||||
"hasPayments": "This member has payments on record.",
|
||||
"error": "We couldn't remove the member from the group."
|
||||
},
|
||||
"preRegistration": {
|
||||
"title": "Pre-registration details",
|
||||
"requestedOn": "Requested on {{date}}",
|
||||
"phone": "Phone",
|
||||
"email": "Email",
|
||||
"fullWarning": "The group is full. If you approve, this person will stay on the waitlist until a spot opens up.",
|
||||
"approve": "Approve",
|
||||
"reject": "Decline",
|
||||
"added": "{{name}} is now a member of the group.",
|
||||
"waitlisted": "{{name}} was added to the waitlist: the group is full.",
|
||||
"alreadyRegistered": "There's already a member with that phone in the group. You can decline the pre-registration.",
|
||||
"alreadyReviewed": "This pre-registration has already been reviewed.",
|
||||
"approveError": "We couldn't approve the pre-registration.",
|
||||
"rejected": "{{name}}'s pre-registration was declined.",
|
||||
"rejectError": "We couldn't decline the pre-registration."
|
||||
},
|
||||
"waitlistEntry": {
|
||||
"title": "Waitlist details",
|
||||
"since": "Waiting since {{date}}",
|
||||
"phone": "Phone",
|
||||
"noPhone": "No phone",
|
||||
"email": "Email",
|
||||
"notes": "Notes",
|
||||
"noNotes": "No notes",
|
||||
"assignTo": "Assign to",
|
||||
"ownGroup": "{{name}} (signed up here)",
|
||||
"fullGroup": "{{name}} (full)",
|
||||
"currentFull": "The group is full. Remove a member or raise the capacity to move this person into the group.",
|
||||
"targetFull": "That group is full. Choose another group or free up a spot first.",
|
||||
"promote": "Move into group",
|
||||
"promoteTo": "Move to {{group}}",
|
||||
"remove": "Remove from waitlist",
|
||||
"promoted": "{{name}} moved from the waitlist into the group.",
|
||||
"promotedTo": "{{name}} moved to {{group}}.",
|
||||
"otherGroup": "another group",
|
||||
"capacityReached": "The group is full. Remove a member or raise the capacity first.",
|
||||
"promoteError": "We couldn't move the member into the group.",
|
||||
"removed": "{{name}} was removed from the waitlist.",
|
||||
"removeError": "We couldn't remove them from the waitlist."
|
||||
},
|
||||
"charge": {
|
||||
"title": "Charge period",
|
||||
"description": "Payment links for {{group}}",
|
||||
"notConnected": "To create payment links, first link your Mercado Pago account.",
|
||||
"connect": "Connect Mercado Pago",
|
||||
"created": "{{linked}} of {{total}} links created",
|
||||
"notGenerated": "Not created",
|
||||
"copied": "Copied",
|
||||
"copyLink": "Copy link",
|
||||
"failedNote": "The ones that failed were saved: you can create their link from Payments without charging the student twice.",
|
||||
"done": "Done",
|
||||
"fee": "Group fee",
|
||||
"dueDate": "Due date",
|
||||
"period": "Period or description",
|
||||
"periodPlaceholder": "E.g. October 2026",
|
||||
"submit": "Create payment links",
|
||||
"mpNotConnected": "Your Mercado Pago account isn't linked.",
|
||||
"noPrice": "This group doesn't have a price yet.",
|
||||
"noAttendees": "There are no active members to charge.",
|
||||
"error": "We couldn't create the payments."
|
||||
},
|
||||
"automations": {
|
||||
"title": "Automatic messages",
|
||||
"summaryOff": "Off",
|
||||
"summary_one": "{{count}} on",
|
||||
"summary_other": "{{count}} on",
|
||||
"channel": "WhatsApp · {{summary}}",
|
||||
"proOnly": "Available on the Pro plan.",
|
||||
"seePlans": "See plans",
|
||||
"goToSettings": "Go to Settings",
|
||||
"paymentReminderTitle": "Weekly payment reminder",
|
||||
"paymentReminderDescription": "To anyone with a pending or overdue payment, with their payment link.",
|
||||
"reengagementTitle": "Weekly re-engagement message",
|
||||
"reengagementDescription": "To members at risk because of absences. At most one every 2 weeks.",
|
||||
"saved": "The group's automatic messages were saved.",
|
||||
"saveError": "We couldn't save the automatic messages."
|
||||
},
|
||||
"absenceNotices": {
|
||||
"title": "Absence notices · this week",
|
||||
"excused": "Excused",
|
||||
"reason": {
|
||||
"health": "Health",
|
||||
"travel": "Travel",
|
||||
"work_study": "Work or school",
|
||||
"other": "Other"
|
||||
}
|
||||
}
|
||||
}
|
||||
68
apps/web/src/i18n/locales/en/groups.json
Normal file
68
apps/web/src/i18n/locales/en/groups.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"title": "Groups",
|
||||
"loading": "Loading groups",
|
||||
"loadError": "We couldn't load your groups.",
|
||||
"empty": {
|
||||
"title": "You don't have any groups yet",
|
||||
"description": "Create your first group and start collecting your students' fees.",
|
||||
"cta": "Create first group"
|
||||
},
|
||||
"myGroups": "My groups",
|
||||
"newGroup": "New group",
|
||||
"attentionPreview": {
|
||||
"title": "Needs attention",
|
||||
"students_one": "{{count}} student",
|
||||
"students_other": "{{count}} students",
|
||||
"seeAll": "See all",
|
||||
"urgent": "Urgent:",
|
||||
"watch": "Watch:"
|
||||
},
|
||||
"card": {
|
||||
"atRisk": "{{count}} at risk",
|
||||
"free_one": "{{count}} spot left",
|
||||
"free_other": "{{count}} spots left",
|
||||
"full": "Full",
|
||||
"students_one": "{{count}} student",
|
||||
"students_other": "{{count}} students",
|
||||
"occupancy": "{{count}} of {{capacity}} spots taken"
|
||||
},
|
||||
"summary": {
|
||||
"groups_one": "{{count}} group",
|
||||
"groups_other": "{{count}} groups",
|
||||
"students_one": "{{count}} student",
|
||||
"students_other": "{{count}} students",
|
||||
"freeSpots_one": "{{count}} free spot",
|
||||
"freeSpots_other": "{{count}} free spots"
|
||||
},
|
||||
"absence": {
|
||||
"streak": "{{count}} absences",
|
||||
"daysAway_one": "{{count}} day away",
|
||||
"daysAway_other": "{{count}} days away",
|
||||
"single": "1 absence",
|
||||
"rate": "{{rate}}% attendance"
|
||||
},
|
||||
"risk": {
|
||||
"HIGH": "High risk",
|
||||
"MEDIUM": "Moderate risk",
|
||||
"hint": "Dropout risk: estimated likelihood that a member leaves the group."
|
||||
},
|
||||
"create": {
|
||||
"heading": "New group",
|
||||
"description": "Set up the class you'll charge for. You can always edit it later.",
|
||||
"submit": "Create group",
|
||||
"error": "We couldn't create the group. Check the details and try again."
|
||||
},
|
||||
"form": {
|
||||
"name": "Group name",
|
||||
"namePlaceholder": "E.g. Vinyasa Yoga · Level 1",
|
||||
"days": "Class days",
|
||||
"time": "Time",
|
||||
"capacity": "Capacity",
|
||||
"price": "Price",
|
||||
"pricePlaceholder": "Per student",
|
||||
"billingType": "Billing type",
|
||||
"dueDay": "Due day",
|
||||
"dueDayHint": "Payments will be due on day {{day}} of each month.",
|
||||
"submitting": "Creating…"
|
||||
}
|
||||
}
|
||||
@@ -48,5 +48,14 @@
|
||||
},
|
||||
"payment": {
|
||||
"descriptionMax": "The description is too long"
|
||||
},
|
||||
"lastName": {
|
||||
"required": "Last name is required"
|
||||
},
|
||||
"bulk": {
|
||||
"empty": "Send at least one student"
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Send at least one attendance record"
|
||||
}
|
||||
}
|
||||
|
||||
56
apps/web/src/i18n/locales/es-419/analytics.json
Normal file
56
apps/web/src/i18n/locales/es-419/analytics.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"back": "Volver al grupo",
|
||||
"subtitle": "Estadísticas",
|
||||
"description": "Asistencia y gestión de riesgo",
|
||||
"period": "Últimos 30 días",
|
||||
"loadError": {
|
||||
"title": "No pudimos cargar las estadísticas",
|
||||
"description": "Revisa tu conexión e inténtalo de nuevo."
|
||||
},
|
||||
"kpi": {
|
||||
"attendanceRate": "Asistencia promedio",
|
||||
"attendanceRateHint": "últimos 30 días",
|
||||
"present": "Asistencias del mes",
|
||||
"presentHint_one": "{{count}} clase dictada",
|
||||
"presentHint_other": "{{count}} clases dictadas",
|
||||
"recovered": "Cupos recuperados",
|
||||
"recoveredHint": "por ausencias avisadas"
|
||||
},
|
||||
"atRisk": {
|
||||
"title": "Alumnos en riesgo",
|
||||
"count_one": "{{count}} alumno",
|
||||
"count_other": "{{count}} alumnos",
|
||||
"description": "Alumnos con faltas seguidas, que dejaron de venir o cuya asistencia viene en baja.",
|
||||
"emptyTitle": "¡Sin alumnos en riesgo!",
|
||||
"emptyDescription": "No hay ausencias consecutivas ni asistencia por debajo del 50%.",
|
||||
"noPhone": "Sin teléfono",
|
||||
"monthlyRate": "{{rate}}% de asistencia mensual",
|
||||
"reengage": "Reenganchar por WhatsApp",
|
||||
"manage": "Gestión de la vacante",
|
||||
"pause": "Pausar vacante",
|
||||
"drop": "Dar de baja",
|
||||
"reasonStreak": "{{count}} faltas seguidas",
|
||||
"reasonDays_one": "{{count}} día sin venir",
|
||||
"reasonDays_other": "{{count}} días sin venir",
|
||||
"reasonTrend": "Asistencia en baja",
|
||||
"reengageMessage": "¡Hola {{name}}! 👋 Te extrañamos en {{group}}. Notamos que no viniste a las últimas clases y queremos que vuelvas. Si tienes algún problema con tus horarios o tu membresía, escríbenos y lo resolvemos juntos.",
|
||||
"yourClass": "tu clase",
|
||||
"openingWhatsapp": "¡Abriendo WhatsApp! Mensaje copiado al portapapeles."
|
||||
},
|
||||
"status": {
|
||||
"dropTitle": "Dar de baja",
|
||||
"pauseTitle": "Pausar vacante",
|
||||
"dropBody": "{{name}} dejará de asistir a <strong>{{group}}</strong>. Su vacante quedará <strong>disponible</strong> para otro alumno y su historial de asistencia se conserva.",
|
||||
"pauseBody": "{{name}} quedará <strong>pausado</strong> en <strong>{{group}}</strong>. Su vacante queda <strong>libre</strong> y puedes reactivarla cuando quieras.",
|
||||
"dropped": "{{name}} salió del grupo. Su vacante quedó disponible.",
|
||||
"paused": "La vacante de {{name}} quedó pausada.",
|
||||
"error": "No pudimos actualizar el estado del alumno."
|
||||
},
|
||||
"history": {
|
||||
"title": "Historial",
|
||||
"description": "Historial de presentismo de las últimas clases.",
|
||||
"error": "No pudimos cargar el historial de este alumno.",
|
||||
"overall_one": "Presentismo general ({{count}} clase)",
|
||||
"overall_other": "Presentismo general ({{count}} clases)"
|
||||
}
|
||||
}
|
||||
@@ -38,5 +38,24 @@
|
||||
"tomorrow": "Mañana · {{time}}",
|
||||
"other": "{{date}} · {{time}}"
|
||||
},
|
||||
"billingDueDay": "Vence el día {{day}} de cada mes"
|
||||
"billingDueDay": "Vence el día {{day}} de cada mes",
|
||||
"weekDayShort": {
|
||||
"MONDAY": "Lun",
|
||||
"TUESDAY": "Mar",
|
||||
"WEDNESDAY": "Mié",
|
||||
"THURSDAY": "Jue",
|
||||
"FRIDAY": "Vie",
|
||||
"SATURDAY": "Sáb",
|
||||
"SUNDAY": "Dom"
|
||||
},
|
||||
"billingTypeHint": {
|
||||
"MONTHLY": "Un cobro al mes",
|
||||
"PER_CLASS": "Cada clase a la que asista"
|
||||
},
|
||||
"attendanceStatus": {
|
||||
"PRESENT": "Presente",
|
||||
"ABSENT": "Ausente",
|
||||
"EXCUSED": "Avisó ausencia",
|
||||
"NONE": "Sin registrar"
|
||||
}
|
||||
}
|
||||
|
||||
97
apps/web/src/i18n/locales/es-419/groupAdd.json
Normal file
97
apps/web/src/i18n/locales/es-419/groupAdd.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"back": "Volver al grupo",
|
||||
"title": "Agregar miembros",
|
||||
"subtitleGroup": "Agrega miembros a <strong>{{group}}</strong> de forma individual o masiva desde una lista.",
|
||||
"subtitle": "Agrega miembros de forma individual o masiva desde una lista.",
|
||||
"occupancy": "{{count}} de {{capacity}} lugares ocupados.",
|
||||
"tabs": {
|
||||
"quick": "Carga rápida (individual)",
|
||||
"bulk": "Carga masiva (CSV / Excel)"
|
||||
},
|
||||
"quick": {
|
||||
"firstName": "Nombre",
|
||||
"firstNamePlaceholder": "Ej.: Lucas",
|
||||
"lastName": "Apellido",
|
||||
"lastNamePlaceholder": "Ej.: González",
|
||||
"phone": "Teléfono / WhatsApp",
|
||||
"phonePlaceholder": "Ej.: +52 55 1234 5678",
|
||||
"phoneHint": "Se usa para contactarlo y detectar duplicados.",
|
||||
"email": "Email (opcional)",
|
||||
"emailPlaceholder": "alumno@ejemplo.com",
|
||||
"notes": "Notas u observaciones (opcional)",
|
||||
"notesPlaceholder": "Ej.: Nivel intermedio, trae materiales propios",
|
||||
"submit": "Guardar miembro",
|
||||
"mustLink": "Ese teléfono ya es de una persona registrada: agrégala o usa otro teléfono.",
|
||||
"required": "Nombre y teléfono son obligatorios."
|
||||
},
|
||||
"existing": {
|
||||
"alreadyInGroup": "{{name}} ya es miembro de este grupo.",
|
||||
"linked": "Agregarás a <strong>{{name}}</strong> a este grupo. Sus datos de contacto y notas son los mismos que en sus otros grupos.",
|
||||
"found": "Ya tienes a <strong>{{name}}</strong> con este teléfono. ¿Es la misma persona?",
|
||||
"foundInGroups": "Ya tienes a <strong>{{name}}</strong> con este teléfono (en {{groups}}). ¿Es la misma persona?",
|
||||
"notThisPerson": "No es esta persona",
|
||||
"otherPhone": "Usar otro teléfono",
|
||||
"confirm": "Sí, agregarla"
|
||||
},
|
||||
"capacity": {
|
||||
"title": "Cupo alcanzado",
|
||||
"description": "El grupo llegó a su cupo máximo de miembros.",
|
||||
"body": "El grupo <strong>{{group}}</strong> ya alcanzó su cupo de <strong>{{capacity}}</strong> miembros. ¿Qué quieres hacer con <strong>{{name}}</strong>?",
|
||||
"force": "Agregar de todos modos",
|
||||
"waitlist": "Sumar a la lista de espera",
|
||||
"forceHint": "Si lo agregas de todos modos, el grupo quedará por encima de su cupo."
|
||||
},
|
||||
"bulkCapacity": {
|
||||
"title": "Aviso de cupo",
|
||||
"description": "La carga supera el cupo del grupo.",
|
||||
"body": "Vas a importar <strong>{{rows}}</strong> miembro(s), pero el grupo ya tiene <strong>{{current}}</strong> inscrito(s) y su cupo es de <strong>{{capacity}}</strong>. ¿Quieres importarlos de todos modos?",
|
||||
"confirm": "Importar de todos modos"
|
||||
},
|
||||
"bulk": {
|
||||
"unsupported": "Formato no compatible. Sube un archivo .csv o .xlsx",
|
||||
"noContacts": "No se detectaron contactos en el archivo.",
|
||||
"detected": "Se detectaron {{count}} filas ({{valid}} válidas).",
|
||||
"processError": "Error al procesar el archivo.",
|
||||
"dropzone": "Arrastra tu archivo aquí o toca para elegirlo",
|
||||
"formats": "Formatos: CSV (.csv) o Excel (.xlsx)",
|
||||
"templateHint": "¿No tienes el archivo listo? Usa nuestra plantilla.",
|
||||
"downloadTemplate": "Descargar plantilla CSV",
|
||||
"parsing": "Leyendo y analizando el archivo...",
|
||||
"preview": "Vista previa:",
|
||||
"ready": "{{count}} listos para importar",
|
||||
"withErrors": "{{count}} con errores",
|
||||
"clear": "Limpiar lista",
|
||||
"name": "Nombre",
|
||||
"phone": "Teléfono",
|
||||
"email": "Email",
|
||||
"status": "Estado",
|
||||
"noName": "Sin nombre",
|
||||
"noPhone": "Sin teléfono",
|
||||
"valid": "Válido",
|
||||
"removeRow": "Eliminar fila",
|
||||
"confirm": "Confirmar e importar ({{count}})",
|
||||
"missingName": "Falta el nombre",
|
||||
"invalidPhone": "Teléfono inválido o faltante",
|
||||
"noSheet": "No se encontró la hoja principal en el archivo Excel.",
|
||||
"noValidRows": "No hay miembros válidos para importar."
|
||||
},
|
||||
"template": {
|
||||
"fileName": "plantilla_alumnos_gruperly.csv",
|
||||
"header": "Nombre,Apellido,Teléfono,Email,Notas",
|
||||
"rows": "Sofía,Rodríguez,+5215512345678,sofia@ejemplo.com,Nivel intermedio\nLucas,Benítez,+5215523456789,lucas@ejemplo.com,Trae instrumento\nValentina,Morales,+5215534567890,,"
|
||||
},
|
||||
"toast": {
|
||||
"created": "{{name}} se agregó al grupo.",
|
||||
"waitlisted": "{{name}} quedó en la lista de espera del grupo.",
|
||||
"personExists": "Ya tienes registrada a una persona con este teléfono. Puedes agregarla a este grupo.",
|
||||
"addError": "No se pudo agregar al miembro.",
|
||||
"alreadyWaitlisted": "Este número ya está en la lista de espera del grupo.",
|
||||
"waitlistError": "No se pudo sumar a la lista de espera.",
|
||||
"importError": "No se pudieron importar los miembros.",
|
||||
"imported_one": "{{count}} alumno agregado.",
|
||||
"imported_other": "{{count}} alumnos agregados.",
|
||||
"importedLinked": "{{count}} ya estaban en otros de tus grupos.",
|
||||
"importedDuplicates_one": "{{count}} duplicado omitido.",
|
||||
"importedDuplicates_other": "{{count}} duplicados omitidos."
|
||||
}
|
||||
}
|
||||
199
apps/web/src/i18n/locales/es-419/groupDetail.json
Normal file
199
apps/web/src/i18n/locales/es-419/groupDetail.json
Normal file
@@ -0,0 +1,199 @@
|
||||
{
|
||||
"fallbackTitle": "Grupo",
|
||||
"header": {
|
||||
"backToGroups": "Volver a grupos",
|
||||
"active": "Activo",
|
||||
"addMember": "Agregar miembro",
|
||||
"stats": "Estadísticas",
|
||||
"charge": "Cobrar",
|
||||
"chargeNoPrice": "Define el precio del grupo para poder cobrar",
|
||||
"share": "Compartir"
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Grupo no encontrado",
|
||||
"description": "No se pudo cargar la información de este grupo.",
|
||||
"back": "Volver a Grupos"
|
||||
},
|
||||
"info": {
|
||||
"schedule": "Horario",
|
||||
"noSchedule": "Sin horario definido",
|
||||
"membersCapacity": "Miembros y cupo",
|
||||
"occupancy": "Ocupación del cupo",
|
||||
"occupancyValue": "{{count}} de {{capacity}}",
|
||||
"noCapacity": "Sin cupo definido",
|
||||
"full": "Cupo completo",
|
||||
"freeSpots_one": "{{count}} lugar libre",
|
||||
"freeSpots_other": "{{count}} lugares libres",
|
||||
"waiting": " · {{count}} en espera",
|
||||
"billing": "Cobro",
|
||||
"noPrice": "Sin precio"
|
||||
},
|
||||
"sections": {
|
||||
"label": "Listado del grupo",
|
||||
"members": "Miembros",
|
||||
"pending": "Pendientes",
|
||||
"searchPlaceholder": "Buscar por nombre o teléfono...",
|
||||
"searchLabel": "Buscar en el listado",
|
||||
"pendingHint": "Preinscripciones que esperan tu aprobación y personas en lista de espera por un cupo libre."
|
||||
},
|
||||
"members": {
|
||||
"overdueFilter": "{{count}} con pago vencido",
|
||||
"emptyTitle": "Todavía no hay miembros en este grupo",
|
||||
"emptyDescription": "Puedes compartir el enlace de invitación o agregar miembros manualmente o de forma masiva.",
|
||||
"shareLink": "Compartir enlace",
|
||||
"addMembers": "Agregar miembros",
|
||||
"noOverdueMatch": "Ningún miembro con pago vencido coincide con la búsqueda.",
|
||||
"noMatch": "No se encontraron miembros que coincidan con la búsqueda.",
|
||||
"classDot": "Clase {{index}} de {{total}}: {{status}}"
|
||||
},
|
||||
"row": {
|
||||
"settled": "Al día",
|
||||
"dueToday": "Vence hoy",
|
||||
"dueTomorrow": "Vence mañana",
|
||||
"dueIn": "Vence en {{days}} d",
|
||||
"overdue": "Vencido · {{days}} d",
|
||||
"noClasses": "Sin clases aún",
|
||||
"attended_one": "{{attended}} de {{count}} clase",
|
||||
"attended_other": "{{attended}} de {{count}} clases"
|
||||
},
|
||||
"pending": {
|
||||
"emptyTitle": "No hay pendientes",
|
||||
"emptyDescription": "Las preinscripciones que lleguen por el enlace compartido y las personas en lista de espera aparecerán aquí para que las revises.",
|
||||
"noMatch": "No se encontraron pendientes que coincidan con la búsqueda.",
|
||||
"preRegistrations": "Preinscripciones",
|
||||
"preRegistrationsEmpty": "Sin preinscripciones pendientes.",
|
||||
"waitlist": "Lista de espera",
|
||||
"waitlistEmpty": "Sin nadie en la lista de espera."
|
||||
},
|
||||
"table": {
|
||||
"name": "Nombre",
|
||||
"phone": "Teléfono",
|
||||
"requested": "Solicitado",
|
||||
"detail": "Detalle"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Compartir link de invitación",
|
||||
"description": "Envía este enlace a tus miembros para que completen sus datos y se preinscriban en el grupo.",
|
||||
"linkLabel": "Enlace único del grupo",
|
||||
"copy": "Copiar",
|
||||
"copyTitle": "Copiar al portapapeles",
|
||||
"previewTitle": "Vista previa del mensaje para WhatsApp:",
|
||||
"copyMessage": "Copiar mensaje",
|
||||
"copyMessageTitle": "Copiar el mensaje completo al portapapeles",
|
||||
"message": "¡Hola! 👋 Te invito a unirte al grupo *{{group}}*.\n\nCompleta tu preinscripción en este enlace. El profesor revisará tu solicitud:\n{{url}}",
|
||||
"messagePreview": "¡Hola! 👋 Te invito a unirte al grupo <strong>{{group}}</strong>.\n\nCompleta tu preinscripción en este enlace. El profesor revisará tu solicitud:\n",
|
||||
"openWhatsapp": "Abrir en WhatsApp",
|
||||
"regenerate": "Regenerar enlace",
|
||||
"regenerateTitle": "Invalida el enlace anterior y genera uno nuevo",
|
||||
"footnote": "Al tocar <strong>Abrir en WhatsApp</strong>, el mensaje completo se copia al portapapeles. Si WhatsApp Web solo carga el enlace, puedes pegarlo con <kbd>Ctrl+V</kbd> o <kbd>Cmd+V</kbd>.",
|
||||
"regenerated": "Se generó un nuevo enlace de invitación.",
|
||||
"regenerateError": "No se pudo regenerar el enlace de invitación.",
|
||||
"linkCopied": "¡Enlace de invitación copiado al portapapeles!",
|
||||
"messageCopied": "¡Mensaje copiado al portapapeles!",
|
||||
"copyError": "No se pudo copiar automáticamente. Copia el texto manualmente.",
|
||||
"openingWhatsapp": "¡Abriendo WhatsApp! Mensaje copiado al portapapeles."
|
||||
},
|
||||
"remove": {
|
||||
"title": "Quitar del grupo",
|
||||
"body": "{{name}} dejará de ser miembro del grupo <strong>{{group}}</strong>.",
|
||||
"bodyFreeSpot": "{{name}} dejará de ser miembro del grupo <strong>{{group}}</strong> y el cupo quedará libre.",
|
||||
"phone": "Teléfono: {{phone}}",
|
||||
"waiting_one": "Hay {{count}} persona esperando un cupo",
|
||||
"waiting_other": "Hay {{count}} personas esperando un cupo",
|
||||
"promoteQuestion": "¿Quieres pasar a <strong>{{name}}</strong>, primero en la lista de espera, al grupo?",
|
||||
"removeAndPromote": "Quitar y pasar a {{name}} al grupo",
|
||||
"removeOnly": "Solo quitar del grupo",
|
||||
"confirm": "Quitar del grupo",
|
||||
"removed": "{{name}} salió del grupo.",
|
||||
"removedPromoted": "{{name}} salió del grupo y {{promoted}} pasó de la lista de espera al grupo.",
|
||||
"hasPayments": "Este miembro tiene cobros asociados.",
|
||||
"error": "No se pudo quitar al miembro del grupo."
|
||||
},
|
||||
"preRegistration": {
|
||||
"title": "Detalle de la preinscripción",
|
||||
"requestedOn": "Solicitado el {{date}}",
|
||||
"phone": "Teléfono",
|
||||
"email": "Email",
|
||||
"fullWarning": "El grupo alcanzó su cupo de miembros. Si apruebas, esta persona quedará en la lista de espera hasta que se libere un lugar.",
|
||||
"approve": "Aprobar",
|
||||
"reject": "Rechazar",
|
||||
"added": "{{name}} ahora es miembro del grupo.",
|
||||
"waitlisted": "{{name}} quedó en la lista de espera: el grupo está completo.",
|
||||
"alreadyRegistered": "Ya hay un miembro con ese teléfono en el grupo. Puedes rechazar la preinscripción.",
|
||||
"alreadyReviewed": "Esta preinscripción ya fue revisada.",
|
||||
"approveError": "No se pudo aprobar la preinscripción.",
|
||||
"rejected": "Se rechazó la preinscripción de {{name}}.",
|
||||
"rejectError": "No se pudo rechazar la preinscripción."
|
||||
},
|
||||
"waitlistEntry": {
|
||||
"title": "Detalle de la lista de espera",
|
||||
"since": "En espera desde el {{date}}",
|
||||
"phone": "Teléfono",
|
||||
"noPhone": "Sin teléfono",
|
||||
"email": "Email",
|
||||
"notes": "Notas",
|
||||
"noNotes": "Sin notas",
|
||||
"assignTo": "Asignar a",
|
||||
"ownGroup": "{{name}} (en el que se anotó)",
|
||||
"fullGroup": "{{name}} (sin cupo)",
|
||||
"currentFull": "El grupo alcanzó su cupo de miembros. Quita un miembro o aumenta el cupo para pasar a esta persona al grupo.",
|
||||
"targetFull": "Ese grupo alcanzó su cupo de miembros. Elige otro grupo o libera un lugar primero.",
|
||||
"promote": "Pasar al grupo",
|
||||
"promoteTo": "Pasar a {{group}}",
|
||||
"remove": "Quitar de la lista de espera",
|
||||
"promoted": "{{name}} pasó de la lista de espera al grupo.",
|
||||
"promotedTo": "{{name}} pasó a {{group}}.",
|
||||
"otherGroup": "otro grupo",
|
||||
"capacityReached": "El grupo alcanzó su cupo. Quita un miembro o aumenta el cupo primero.",
|
||||
"promoteError": "No se pudo pasar al miembro al grupo.",
|
||||
"removed": "{{name}} salió de la lista de espera.",
|
||||
"removeError": "No se pudo quitar de la lista de espera."
|
||||
},
|
||||
"charge": {
|
||||
"title": "Cobrar período",
|
||||
"description": "Links de pago para {{group}}",
|
||||
"notConnected": "Para crear links de pago primero vincula tu cuenta de Mercado Pago.",
|
||||
"connect": "Conectar Mercado Pago",
|
||||
"created": "{{linked}} de {{total}} links creados",
|
||||
"notGenerated": "No se generó",
|
||||
"copied": "Copiado",
|
||||
"copyLink": "Copiar link",
|
||||
"failedNote": "Los que no se generaron quedaron guardados: podrás crearles el link desde Cobros sin cobrarle nada al alumno.",
|
||||
"done": "Listo",
|
||||
"fee": "Cuota del grupo",
|
||||
"dueDate": "Vencimiento",
|
||||
"period": "Período o concepto",
|
||||
"periodPlaceholder": "Ej.: Octubre 2026",
|
||||
"submit": "Crear links de pago",
|
||||
"mpNotConnected": "Tu cuenta de Mercado Pago no está vinculada.",
|
||||
"noPrice": "Este grupo todavía no tiene precio.",
|
||||
"noAttendees": "No hay miembros activos para cobrar.",
|
||||
"error": "No pudimos crear los cobros."
|
||||
},
|
||||
"automations": {
|
||||
"title": "Mensajes automáticos",
|
||||
"summaryOff": "Apagados",
|
||||
"summary_one": "{{count}} activo",
|
||||
"summary_other": "{{count}} activos",
|
||||
"channel": "WhatsApp · {{summary}}",
|
||||
"proOnly": "Disponible en el plan Pro.",
|
||||
"seePlans": "Ver planes",
|
||||
"goToSettings": "Ir a Ajustes",
|
||||
"paymentReminderTitle": "Recordatorio semanal de pago",
|
||||
"paymentReminderDescription": "A quien tenga un cobro pendiente o vencido, con su link de pago.",
|
||||
"reengagementTitle": "Mensaje de reenganche semanal",
|
||||
"reengagementDescription": "A los miembros en riesgo por faltas. Como mucho uno cada 2 semanas.",
|
||||
"saved": "Guardamos los mensajes automáticos del grupo.",
|
||||
"saveError": "No se pudieron guardar los mensajes automáticos."
|
||||
},
|
||||
"absenceNotices": {
|
||||
"title": "Faltas avisadas · esta semana",
|
||||
"excused": "Justificada",
|
||||
"reason": {
|
||||
"health": "Salud",
|
||||
"travel": "Viaje",
|
||||
"work_study": "Trabajo o estudio",
|
||||
"other": "Otro"
|
||||
}
|
||||
}
|
||||
}
|
||||
68
apps/web/src/i18n/locales/es-419/groups.json
Normal file
68
apps/web/src/i18n/locales/es-419/groups.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"title": "Grupos",
|
||||
"loading": "Cargando grupos",
|
||||
"loadError": "No pudimos cargar tus grupos.",
|
||||
"empty": {
|
||||
"title": "Todavía no tienes grupos",
|
||||
"description": "Crea tu primer grupo y empieza a cobrar las cuotas de tus alumnos.",
|
||||
"cta": "Crear primer grupo"
|
||||
},
|
||||
"myGroups": "Mis grupos",
|
||||
"newGroup": "Nuevo grupo",
|
||||
"attentionPreview": {
|
||||
"title": "Requiere atención",
|
||||
"students_one": "{{count}} alumno",
|
||||
"students_other": "{{count}} alumnos",
|
||||
"seeAll": "Ver todos",
|
||||
"urgent": "Urgente:",
|
||||
"watch": "Para vigilar:"
|
||||
},
|
||||
"card": {
|
||||
"atRisk": "{{count}} en riesgo",
|
||||
"free_one": "{{count}} libre",
|
||||
"free_other": "{{count}} libres",
|
||||
"full": "Completo",
|
||||
"students_one": "{{count}} alumno",
|
||||
"students_other": "{{count}} alumnos",
|
||||
"occupancy": "{{count}} de {{capacity}} lugares ocupados"
|
||||
},
|
||||
"summary": {
|
||||
"groups_one": "{{count}} grupo",
|
||||
"groups_other": "{{count}} grupos",
|
||||
"students_one": "{{count}} alumno",
|
||||
"students_other": "{{count}} alumnos",
|
||||
"freeSpots_one": "{{count}} lugar libre",
|
||||
"freeSpots_other": "{{count}} lugares libres"
|
||||
},
|
||||
"absence": {
|
||||
"streak": "{{count}} faltas",
|
||||
"daysAway_one": "{{count}} día sin venir",
|
||||
"daysAway_other": "{{count}} días sin venir",
|
||||
"single": "1 falta",
|
||||
"rate": "asistencia {{rate}}%"
|
||||
},
|
||||
"risk": {
|
||||
"HIGH": "Riesgo alto",
|
||||
"MEDIUM": "Riesgo moderado",
|
||||
"hint": "Riesgo de abandono: probabilidad estimada de que algún miembro deje el grupo."
|
||||
},
|
||||
"create": {
|
||||
"heading": "Nuevo grupo",
|
||||
"description": "Define los datos de la clase que vas a cobrar. Después siempre puedes editarlos.",
|
||||
"submit": "Crear grupo",
|
||||
"error": "No pudimos crear el grupo. Revisa los datos e inténtalo de nuevo."
|
||||
},
|
||||
"form": {
|
||||
"name": "Nombre del grupo",
|
||||
"namePlaceholder": "Ej.: Yoga Vinyasa · Nivel 1",
|
||||
"days": "Días de clase",
|
||||
"time": "Horario",
|
||||
"capacity": "Cupo máximo",
|
||||
"price": "Precio",
|
||||
"pricePlaceholder": "Por alumno",
|
||||
"billingType": "Tipo de cobro",
|
||||
"dueDay": "Día de vencimiento",
|
||||
"dueDayHint": "Los cobros vencerán el día {{day}} de cada mes.",
|
||||
"submitting": "Creando…"
|
||||
}
|
||||
}
|
||||
@@ -48,5 +48,14 @@
|
||||
},
|
||||
"payment": {
|
||||
"descriptionMax": "La descripción es demasiado larga"
|
||||
},
|
||||
"lastName": {
|
||||
"required": "El apellido es obligatorio"
|
||||
},
|
||||
"bulk": {
|
||||
"empty": "Envía al menos un alumno"
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Envía al menos un registro de asistencia"
|
||||
}
|
||||
}
|
||||
|
||||
56
apps/web/src/i18n/locales/es-AR/analytics.json
Normal file
56
apps/web/src/i18n/locales/es-AR/analytics.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"back": "Volver al grupo",
|
||||
"subtitle": "Estadísticas",
|
||||
"description": "Asistencia y gestión de riesgo",
|
||||
"period": "Últimos 30 días",
|
||||
"loadError": {
|
||||
"title": "No pudimos cargar las estadísticas",
|
||||
"description": "Revisá tu conexión e intentá de nuevo."
|
||||
},
|
||||
"kpi": {
|
||||
"attendanceRate": "Asistencia promedio",
|
||||
"attendanceRateHint": "últimos 30 días",
|
||||
"present": "Asistencias del mes",
|
||||
"presentHint_one": "{{count}} clase dictada",
|
||||
"presentHint_other": "{{count}} clases dictadas",
|
||||
"recovered": "Cupos recuperados",
|
||||
"recoveredHint": "por ausencias avisadas"
|
||||
},
|
||||
"atRisk": {
|
||||
"title": "Alumnos en riesgo",
|
||||
"count_one": "{{count}} alumno",
|
||||
"count_other": "{{count}} alumnos",
|
||||
"description": "Alumnos con faltas seguidas, que dejaron de venir o cuya asistencia viene en baja.",
|
||||
"emptyTitle": "¡Sin alumnos en riesgo!",
|
||||
"emptyDescription": "No hay ausencias consecutivas ni asistencia por debajo del 50%.",
|
||||
"noPhone": "Sin teléfono",
|
||||
"monthlyRate": "{{rate}}% de asistencia mensual",
|
||||
"reengage": "Reenganchar por WhatsApp",
|
||||
"manage": "Gestión de la vacante",
|
||||
"pause": "Pausar vacante",
|
||||
"drop": "Dar de baja",
|
||||
"reasonStreak": "{{count}} faltas seguidas",
|
||||
"reasonDays_one": "{{count}} día sin venir",
|
||||
"reasonDays_other": "{{count}} días sin venir",
|
||||
"reasonTrend": "Asistencia en baja",
|
||||
"reengageMessage": "¡Hola {{name}}! 👋 Te extrañamos en {{group}}. Notamos que no viniste a las últimas clases y queremos que vuelvas. Si tenés algún problema con tus horarios o tu membresía, escribinos y lo resolvemos juntos.",
|
||||
"yourClass": "tu clase",
|
||||
"openingWhatsapp": "¡Abriendo WhatsApp! Mensaje copiado al portapapeles."
|
||||
},
|
||||
"status": {
|
||||
"dropTitle": "Dar de baja",
|
||||
"pauseTitle": "Pausar vacante",
|
||||
"dropBody": "{{name}} va a dejar de asistir a <strong>{{group}}</strong>. Su vacante va a quedar <strong>disponible</strong> para otro alumno y su historial de asistencia se conserva.",
|
||||
"pauseBody": "{{name}} va a quedar <strong>pausado</strong> en <strong>{{group}}</strong>. Su vacante queda <strong>libre</strong> y podés reactivarla cuando quieras.",
|
||||
"dropped": "{{name}} salió del grupo. Su vacante quedó disponible.",
|
||||
"paused": "La vacante de {{name}} quedó pausada.",
|
||||
"error": "No pudimos actualizar el estado del alumno."
|
||||
},
|
||||
"history": {
|
||||
"title": "Historial",
|
||||
"description": "Historial de presentismo de las últimas clases.",
|
||||
"error": "No pudimos cargar el historial de este alumno.",
|
||||
"overall_one": "Presentismo general ({{count}} clase)",
|
||||
"overall_other": "Presentismo general ({{count}} clases)"
|
||||
}
|
||||
}
|
||||
@@ -38,5 +38,24 @@
|
||||
"tomorrow": "Mañana · {{time}}",
|
||||
"other": "{{date}} · {{time}}"
|
||||
},
|
||||
"billingDueDay": "Vence el día {{day}} de cada mes"
|
||||
"billingDueDay": "Vence el día {{day}} de cada mes",
|
||||
"weekDayShort": {
|
||||
"MONDAY": "Lun",
|
||||
"TUESDAY": "Mar",
|
||||
"WEDNESDAY": "Mié",
|
||||
"THURSDAY": "Jue",
|
||||
"FRIDAY": "Vie",
|
||||
"SATURDAY": "Sáb",
|
||||
"SUNDAY": "Dom"
|
||||
},
|
||||
"billingTypeHint": {
|
||||
"MONTHLY": "Un cobro por mes",
|
||||
"PER_CLASS": "Cada clase que asista"
|
||||
},
|
||||
"attendanceStatus": {
|
||||
"PRESENT": "Presente",
|
||||
"ABSENT": "Ausente",
|
||||
"EXCUSED": "Avisó ausencia",
|
||||
"NONE": "Sin registrar"
|
||||
}
|
||||
}
|
||||
|
||||
97
apps/web/src/i18n/locales/es-AR/groupAdd.json
Normal file
97
apps/web/src/i18n/locales/es-AR/groupAdd.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"back": "Volver al grupo",
|
||||
"title": "Agregar miembros",
|
||||
"subtitleGroup": "Sumá miembros a <strong>{{group}}</strong> de forma individual o masiva desde una lista.",
|
||||
"subtitle": "Sumá miembros de forma individual o masiva desde una lista.",
|
||||
"occupancy": "{{count}} de {{capacity}} lugares ocupados.",
|
||||
"tabs": {
|
||||
"quick": "Carga rápida (individual)",
|
||||
"bulk": "Carga masiva (CSV / Excel)"
|
||||
},
|
||||
"quick": {
|
||||
"firstName": "Nombre",
|
||||
"firstNamePlaceholder": "Ej.: Lucas",
|
||||
"lastName": "Apellido",
|
||||
"lastNamePlaceholder": "Ej.: González",
|
||||
"phone": "Teléfono / WhatsApp",
|
||||
"phonePlaceholder": "Ej.: +54 9 11 2345-6789",
|
||||
"phoneHint": "Se usa para contactarlo y detectar duplicados.",
|
||||
"email": "Email (opcional)",
|
||||
"emailPlaceholder": "alumno@ejemplo.com",
|
||||
"notes": "Notas u observaciones (opcional)",
|
||||
"notesPlaceholder": "Ej.: Nivel intermedio, trae materiales propios",
|
||||
"submit": "Guardar miembro",
|
||||
"mustLink": "Ese teléfono ya es de una persona registrada: agregala o usá otro teléfono.",
|
||||
"required": "Nombre y teléfono son obligatorios."
|
||||
},
|
||||
"existing": {
|
||||
"alreadyInGroup": "{{name}} ya es miembro de este grupo.",
|
||||
"linked": "Vas a agregar a <strong>{{name}}</strong> a este grupo. Sus datos de contacto y notas son los mismos que en sus otros grupos.",
|
||||
"found": "Ya tenés a <strong>{{name}}</strong> con este teléfono. ¿Es la misma persona?",
|
||||
"foundInGroups": "Ya tenés a <strong>{{name}}</strong> con este teléfono (en {{groups}}). ¿Es la misma persona?",
|
||||
"notThisPerson": "No es esta persona",
|
||||
"otherPhone": "Usar otro teléfono",
|
||||
"confirm": "Sí, agregarla"
|
||||
},
|
||||
"capacity": {
|
||||
"title": "Cupo alcanzado",
|
||||
"description": "El grupo llegó a su cupo máximo de miembros.",
|
||||
"body": "El grupo <strong>{{group}}</strong> ya alcanzó su cupo de <strong>{{capacity}}</strong> miembros. ¿Qué querés hacer con <strong>{{name}}</strong>?",
|
||||
"force": "Agregar de todos modos",
|
||||
"waitlist": "Sumar a la lista de espera",
|
||||
"forceHint": "Si lo agregás de todos modos, el grupo va a quedar por encima de su cupo."
|
||||
},
|
||||
"bulkCapacity": {
|
||||
"title": "Aviso de cupo",
|
||||
"description": "La carga supera el cupo del grupo.",
|
||||
"body": "Estás por importar <strong>{{rows}}</strong> miembro(s), pero el grupo ya tiene <strong>{{current}}</strong> inscrito(s) y su cupo es de <strong>{{capacity}}</strong>. ¿Querés importarlos de todos modos?",
|
||||
"confirm": "Importar de todos modos"
|
||||
},
|
||||
"bulk": {
|
||||
"unsupported": "Formato no compatible. Subí un archivo .csv o .xlsx",
|
||||
"noContacts": "No se detectaron contactos en el archivo.",
|
||||
"detected": "Se detectaron {{count}} filas ({{valid}} válidas).",
|
||||
"processError": "Error al procesar el archivo.",
|
||||
"dropzone": "Arrastrá tu archivo acá o tocá para elegirlo",
|
||||
"formats": "Formatos: CSV (.csv) o Excel (.xlsx)",
|
||||
"templateHint": "¿No tenés el archivo listo? Usá nuestra plantilla.",
|
||||
"downloadTemplate": "Descargar plantilla CSV",
|
||||
"parsing": "Leyendo y analizando el archivo...",
|
||||
"preview": "Vista previa:",
|
||||
"ready": "{{count}} listos para importar",
|
||||
"withErrors": "{{count}} con errores",
|
||||
"clear": "Limpiar lista",
|
||||
"name": "Nombre",
|
||||
"phone": "Teléfono",
|
||||
"email": "Email",
|
||||
"status": "Estado",
|
||||
"noName": "Sin nombre",
|
||||
"noPhone": "Sin teléfono",
|
||||
"valid": "Válido",
|
||||
"removeRow": "Eliminar fila",
|
||||
"confirm": "Confirmar e importar ({{count}})",
|
||||
"missingName": "Falta el nombre",
|
||||
"invalidPhone": "Teléfono inválido o faltante",
|
||||
"noSheet": "No se encontró la hoja principal en el archivo Excel.",
|
||||
"noValidRows": "No hay miembros válidos para importar."
|
||||
},
|
||||
"template": {
|
||||
"fileName": "plantilla_alumnos_gruperly.csv",
|
||||
"header": "Nombre,Apellido,Teléfono,Email,Notas",
|
||||
"rows": "Sofía,Rodríguez,+5491144556677,sofia@ejemplo.com,Nivel intermedio\nLucas,Benítez,+5491155667788,lucas@ejemplo.com,Trae instrumento\nValentina,Morales,+5491166778899,,"
|
||||
},
|
||||
"toast": {
|
||||
"created": "{{name}} se agregó al grupo.",
|
||||
"waitlisted": "{{name}} quedó en la lista de espera del grupo.",
|
||||
"personExists": "Ya tenés registrada a una persona con este teléfono. Podés agregarla a este grupo.",
|
||||
"addError": "No se pudo agregar al miembro.",
|
||||
"alreadyWaitlisted": "Este número ya está en la lista de espera del grupo.",
|
||||
"waitlistError": "No se pudo sumar a la lista de espera.",
|
||||
"importError": "No se pudieron importar los miembros.",
|
||||
"imported_one": "{{count}} alumno agregado.",
|
||||
"imported_other": "{{count}} alumnos agregados.",
|
||||
"importedLinked": "{{count}} ya estaban en otros de tus grupos.",
|
||||
"importedDuplicates_one": "{{count}} duplicado omitido.",
|
||||
"importedDuplicates_other": "{{count}} duplicados omitidos."
|
||||
}
|
||||
}
|
||||
199
apps/web/src/i18n/locales/es-AR/groupDetail.json
Normal file
199
apps/web/src/i18n/locales/es-AR/groupDetail.json
Normal file
@@ -0,0 +1,199 @@
|
||||
{
|
||||
"fallbackTitle": "Grupo",
|
||||
"header": {
|
||||
"backToGroups": "Volver a grupos",
|
||||
"active": "Activo",
|
||||
"addMember": "Agregar miembro",
|
||||
"stats": "Estadísticas",
|
||||
"charge": "Cobrar",
|
||||
"chargeNoPrice": "Definí el precio del grupo para poder cobrar",
|
||||
"share": "Compartir"
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Grupo no encontrado",
|
||||
"description": "No se pudo cargar la información de este grupo.",
|
||||
"back": "Volver a Grupos"
|
||||
},
|
||||
"info": {
|
||||
"schedule": "Horario",
|
||||
"noSchedule": "Sin horario definido",
|
||||
"membersCapacity": "Miembros y cupo",
|
||||
"occupancy": "Ocupación del cupo",
|
||||
"occupancyValue": "{{count}} de {{capacity}}",
|
||||
"noCapacity": "Sin cupo definido",
|
||||
"full": "Cupo completo",
|
||||
"freeSpots_one": "{{count}} lugar libre",
|
||||
"freeSpots_other": "{{count}} lugares libres",
|
||||
"waiting": " · {{count}} en espera",
|
||||
"billing": "Cobro",
|
||||
"noPrice": "Sin precio"
|
||||
},
|
||||
"sections": {
|
||||
"label": "Listado del grupo",
|
||||
"members": "Miembros",
|
||||
"pending": "Pendientes",
|
||||
"searchPlaceholder": "Buscar por nombre o teléfono...",
|
||||
"searchLabel": "Buscar en el listado",
|
||||
"pendingHint": "Preinscripciones que esperan tu aprobación y personas en lista de espera por un cupo libre."
|
||||
},
|
||||
"members": {
|
||||
"overdueFilter": "{{count}} con pago vencido",
|
||||
"emptyTitle": "Todavía no hay miembros en este grupo",
|
||||
"emptyDescription": "Podés compartir el enlace de invitación o agregar miembros a mano o de forma masiva.",
|
||||
"shareLink": "Compartir enlace",
|
||||
"addMembers": "Agregar miembros",
|
||||
"noOverdueMatch": "Ningún miembro con pago vencido coincide con la búsqueda.",
|
||||
"noMatch": "No se encontraron miembros que coincidan con la búsqueda.",
|
||||
"classDot": "Clase {{index}} de {{total}}: {{status}}"
|
||||
},
|
||||
"row": {
|
||||
"settled": "Al día",
|
||||
"dueToday": "Vence hoy",
|
||||
"dueTomorrow": "Vence mañana",
|
||||
"dueIn": "Vence en {{days}} d",
|
||||
"overdue": "Vencido · {{days}} d",
|
||||
"noClasses": "Sin clases aún",
|
||||
"attended_one": "{{attended}} de {{count}} clase",
|
||||
"attended_other": "{{attended}} de {{count}} clases"
|
||||
},
|
||||
"pending": {
|
||||
"emptyTitle": "No hay pendientes",
|
||||
"emptyDescription": "Las preinscripciones que lleguen por el enlace compartido y las personas en lista de espera van a aparecer acá para que las revises.",
|
||||
"noMatch": "No se encontraron pendientes que coincidan con la búsqueda.",
|
||||
"preRegistrations": "Preinscripciones",
|
||||
"preRegistrationsEmpty": "Sin preinscripciones pendientes.",
|
||||
"waitlist": "Lista de espera",
|
||||
"waitlistEmpty": "Sin nadie en la lista de espera."
|
||||
},
|
||||
"table": {
|
||||
"name": "Nombre",
|
||||
"phone": "Teléfono",
|
||||
"requested": "Solicitado",
|
||||
"detail": "Detalle"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Compartir link de invitación",
|
||||
"description": "Mandales este enlace a tus miembros para que completen sus datos y se preinscriban en el grupo.",
|
||||
"linkLabel": "Enlace único del grupo",
|
||||
"copy": "Copiar",
|
||||
"copyTitle": "Copiar al portapapeles",
|
||||
"previewTitle": "Vista previa del mensaje para WhatsApp:",
|
||||
"copyMessage": "Copiar mensaje",
|
||||
"copyMessageTitle": "Copiar el mensaje completo al portapapeles",
|
||||
"message": "¡Hola! 👋 Te invito a sumarte al grupo *{{group}}*.\n\nCompletá tu preinscripción en este enlace. El profesor va a revisar tu solicitud:\n{{url}}",
|
||||
"messagePreview": "¡Hola! 👋 Te invito a sumarte al grupo <strong>{{group}}</strong>.\n\nCompletá tu preinscripción en este enlace. El profesor va a revisar tu solicitud:\n",
|
||||
"openWhatsapp": "Abrir en WhatsApp",
|
||||
"regenerate": "Regenerar enlace",
|
||||
"regenerateTitle": "Invalida el enlace anterior y genera uno nuevo",
|
||||
"footnote": "Al tocar <strong>Abrir en WhatsApp</strong>, el mensaje completo se copia al portapapeles. Si WhatsApp Web solo carga el enlace, podés pegarlo con <kbd>Ctrl+V</kbd> o <kbd>Cmd+V</kbd>.",
|
||||
"regenerated": "Se generó un nuevo enlace de invitación.",
|
||||
"regenerateError": "No se pudo regenerar el enlace de invitación.",
|
||||
"linkCopied": "¡Enlace de invitación copiado al portapapeles!",
|
||||
"messageCopied": "¡Mensaje copiado al portapapeles!",
|
||||
"copyError": "No se pudo copiar automáticamente. Copiá el texto a mano.",
|
||||
"openingWhatsapp": "¡Abriendo WhatsApp! Mensaje copiado al portapapeles."
|
||||
},
|
||||
"remove": {
|
||||
"title": "Quitar del grupo",
|
||||
"body": "{{name}} va a dejar de ser miembro del grupo <strong>{{group}}</strong>.",
|
||||
"bodyFreeSpot": "{{name}} va a dejar de ser miembro del grupo <strong>{{group}}</strong> y el cupo va a quedar libre.",
|
||||
"phone": "Teléfono: {{phone}}",
|
||||
"waiting_one": "Hay {{count}} persona esperando un cupo",
|
||||
"waiting_other": "Hay {{count}} personas esperando un cupo",
|
||||
"promoteQuestion": "¿Querés pasar a <strong>{{name}}</strong>, primero en la lista de espera, al grupo?",
|
||||
"removeAndPromote": "Quitar y pasar a {{name}} al grupo",
|
||||
"removeOnly": "Solo quitar del grupo",
|
||||
"confirm": "Quitar del grupo",
|
||||
"removed": "{{name}} salió del grupo.",
|
||||
"removedPromoted": "{{name}} salió del grupo y {{promoted}} pasó de la lista de espera al grupo.",
|
||||
"hasPayments": "Este miembro tiene cobros asociados.",
|
||||
"error": "No se pudo quitar al miembro del grupo."
|
||||
},
|
||||
"preRegistration": {
|
||||
"title": "Detalle de la preinscripción",
|
||||
"requestedOn": "Solicitado el {{date}}",
|
||||
"phone": "Teléfono",
|
||||
"email": "Email",
|
||||
"fullWarning": "El grupo alcanzó su cupo de miembros. Si aprobás, esta persona va a quedar en la lista de espera hasta que se libere un lugar.",
|
||||
"approve": "Aprobar",
|
||||
"reject": "Rechazar",
|
||||
"added": "{{name}} ahora es miembro del grupo.",
|
||||
"waitlisted": "{{name}} quedó en la lista de espera: el grupo está completo.",
|
||||
"alreadyRegistered": "Ya hay un miembro con ese teléfono en el grupo. Podés rechazar la preinscripción.",
|
||||
"alreadyReviewed": "Esta preinscripción ya fue revisada.",
|
||||
"approveError": "No se pudo aprobar la preinscripción.",
|
||||
"rejected": "Se rechazó la preinscripción de {{name}}.",
|
||||
"rejectError": "No se pudo rechazar la preinscripción."
|
||||
},
|
||||
"waitlistEntry": {
|
||||
"title": "Detalle de la lista de espera",
|
||||
"since": "En espera desde el {{date}}",
|
||||
"phone": "Teléfono",
|
||||
"noPhone": "Sin teléfono",
|
||||
"email": "Email",
|
||||
"notes": "Notas",
|
||||
"noNotes": "Sin notas",
|
||||
"assignTo": "Asignar a",
|
||||
"ownGroup": "{{name}} (en el que se anotó)",
|
||||
"fullGroup": "{{name}} (sin cupo)",
|
||||
"currentFull": "El grupo alcanzó su cupo de miembros. Quitá un miembro o aumentá el cupo para pasar a esta persona al grupo.",
|
||||
"targetFull": "Ese grupo alcanzó su cupo de miembros. Elegí otro grupo o liberá un lugar primero.",
|
||||
"promote": "Pasar al grupo",
|
||||
"promoteTo": "Pasar a {{group}}",
|
||||
"remove": "Quitar de la lista de espera",
|
||||
"promoted": "{{name}} pasó de la lista de espera al grupo.",
|
||||
"promotedTo": "{{name}} pasó a {{group}}.",
|
||||
"otherGroup": "otro grupo",
|
||||
"capacityReached": "El grupo alcanzó su cupo. Quitá un miembro o aumentá el cupo primero.",
|
||||
"promoteError": "No se pudo pasar al miembro al grupo.",
|
||||
"removed": "{{name}} salió de la lista de espera.",
|
||||
"removeError": "No se pudo quitar de la lista de espera."
|
||||
},
|
||||
"charge": {
|
||||
"title": "Cobrar período",
|
||||
"description": "Links de pago para {{group}}",
|
||||
"notConnected": "Para crear links de pago primero vinculá tu cuenta de Mercado Pago.",
|
||||
"connect": "Conectar Mercado Pago",
|
||||
"created": "{{linked}} de {{total}} links creados",
|
||||
"notGenerated": "No se generó",
|
||||
"copied": "Copiado",
|
||||
"copyLink": "Copiar link",
|
||||
"failedNote": "Los que no se generaron quedaron guardados: vas a poder crearles el link desde Cobros sin cargarle nada al alumno.",
|
||||
"done": "Listo",
|
||||
"fee": "Cuota del grupo",
|
||||
"dueDate": "Vencimiento",
|
||||
"period": "Período o concepto",
|
||||
"periodPlaceholder": "Ej.: Octubre 2026",
|
||||
"submit": "Crear links de pago",
|
||||
"mpNotConnected": "Tu cuenta de Mercado Pago no está vinculada.",
|
||||
"noPrice": "Este grupo todavía no tiene precio.",
|
||||
"noAttendees": "No hay miembros activos para cobrar.",
|
||||
"error": "No pudimos crear los cobros."
|
||||
},
|
||||
"automations": {
|
||||
"title": "Mensajes automáticos",
|
||||
"summaryOff": "Apagados",
|
||||
"summary_one": "{{count}} activo",
|
||||
"summary_other": "{{count}} activos",
|
||||
"channel": "WhatsApp · {{summary}}",
|
||||
"proOnly": "Disponible en el plan Pro.",
|
||||
"seePlans": "Ver planes",
|
||||
"goToSettings": "Ir a Ajustes",
|
||||
"paymentReminderTitle": "Recordatorio semanal de pago",
|
||||
"paymentReminderDescription": "A quien tenga un cobro pendiente o vencido, con su link de pago.",
|
||||
"reengagementTitle": "Mensaje de reenganche semanal",
|
||||
"reengagementDescription": "A los miembros en riesgo por faltas. Como mucho uno cada 2 semanas.",
|
||||
"saved": "Guardamos los mensajes automáticos del grupo.",
|
||||
"saveError": "No se pudieron guardar los mensajes automáticos."
|
||||
},
|
||||
"absenceNotices": {
|
||||
"title": "Faltas avisadas · esta semana",
|
||||
"excused": "Justificada",
|
||||
"reason": {
|
||||
"health": "Salud",
|
||||
"travel": "Viaje",
|
||||
"work_study": "Trabajo o estudio",
|
||||
"other": "Otro"
|
||||
}
|
||||
}
|
||||
}
|
||||
68
apps/web/src/i18n/locales/es-AR/groups.json
Normal file
68
apps/web/src/i18n/locales/es-AR/groups.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"title": "Grupos",
|
||||
"loading": "Cargando grupos",
|
||||
"loadError": "No pudimos cargar tus grupos.",
|
||||
"empty": {
|
||||
"title": "Todavía no tenés grupos",
|
||||
"description": "Creá tu primer grupo y empezá a cobrar las cuotas de tus alumnos.",
|
||||
"cta": "Crear primer grupo"
|
||||
},
|
||||
"myGroups": "Mis grupos",
|
||||
"newGroup": "Nuevo grupo",
|
||||
"attentionPreview": {
|
||||
"title": "Requiere atención",
|
||||
"students_one": "{{count}} alumno",
|
||||
"students_other": "{{count}} alumnos",
|
||||
"seeAll": "Ver todos",
|
||||
"urgent": "Urgente:",
|
||||
"watch": "A vigilar:"
|
||||
},
|
||||
"card": {
|
||||
"atRisk": "{{count}} en riesgo",
|
||||
"free_one": "{{count}} libre",
|
||||
"free_other": "{{count}} libres",
|
||||
"full": "Completo",
|
||||
"students_one": "{{count}} alumno",
|
||||
"students_other": "{{count}} alumnos",
|
||||
"occupancy": "{{count}} de {{capacity}} lugares ocupados"
|
||||
},
|
||||
"summary": {
|
||||
"groups_one": "{{count}} grupo",
|
||||
"groups_other": "{{count}} grupos",
|
||||
"students_one": "{{count}} alumno",
|
||||
"students_other": "{{count}} alumnos",
|
||||
"freeSpots_one": "{{count}} lugar libre",
|
||||
"freeSpots_other": "{{count}} lugares libres"
|
||||
},
|
||||
"absence": {
|
||||
"streak": "{{count}} faltas",
|
||||
"daysAway_one": "{{count}} día sin venir",
|
||||
"daysAway_other": "{{count}} días sin venir",
|
||||
"single": "1 falta",
|
||||
"rate": "asistencia {{rate}}%"
|
||||
},
|
||||
"risk": {
|
||||
"HIGH": "Riesgo alto",
|
||||
"MEDIUM": "Riesgo moderado",
|
||||
"hint": "Riesgo de abandono: probabilidad estimada de que algún miembro abandone el grupo."
|
||||
},
|
||||
"create": {
|
||||
"heading": "Nuevo grupo",
|
||||
"description": "Definí los datos de la clase que vas a cobrar. Después siempre podés editarlos.",
|
||||
"submit": "Crear grupo",
|
||||
"error": "No pudimos crear el grupo. Revisá los datos e intentá de nuevo."
|
||||
},
|
||||
"form": {
|
||||
"name": "Nombre del grupo",
|
||||
"namePlaceholder": "Ej: Yoga Vinyasa · Nivel 1",
|
||||
"days": "Días de clase",
|
||||
"time": "Horario",
|
||||
"capacity": "Cupo máximo",
|
||||
"price": "Precio",
|
||||
"pricePlaceholder": "Por alumno",
|
||||
"billingType": "Tipo de cobro",
|
||||
"dueDay": "Día de vencimiento",
|
||||
"dueDayHint": "Los cobros vencerán el día {{day}} de cada mes.",
|
||||
"submitting": "Creando…"
|
||||
}
|
||||
}
|
||||
@@ -48,5 +48,14 @@
|
||||
},
|
||||
"payment": {
|
||||
"descriptionMax": "La descripción es demasiado larga"
|
||||
},
|
||||
"lastName": {
|
||||
"required": "El apellido es obligatorio"
|
||||
},
|
||||
"bulk": {
|
||||
"empty": "Mandá al menos un alumno"
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Mandá al menos un registro de asistencia"
|
||||
}
|
||||
}
|
||||
|
||||
56
apps/web/src/i18n/locales/pt-BR/analytics.json
Normal file
56
apps/web/src/i18n/locales/pt-BR/analytics.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"back": "Voltar ao grupo",
|
||||
"subtitle": "Estatísticas",
|
||||
"description": "Presença e gestão de risco",
|
||||
"period": "Últimos 30 dias",
|
||||
"loadError": {
|
||||
"title": "Não conseguimos carregar as estatísticas",
|
||||
"description": "Verifique sua conexão e tente novamente."
|
||||
},
|
||||
"kpi": {
|
||||
"attendanceRate": "Presença média",
|
||||
"attendanceRateHint": "últimos 30 dias",
|
||||
"present": "Presenças no mês",
|
||||
"presentHint_one": "{{count}} aula dada",
|
||||
"presentHint_other": "{{count}} aulas dadas",
|
||||
"recovered": "Vagas recuperadas",
|
||||
"recoveredHint": "por faltas avisadas"
|
||||
},
|
||||
"atRisk": {
|
||||
"title": "Alunos em risco",
|
||||
"count_one": "{{count}} aluno",
|
||||
"count_other": "{{count}} alunos",
|
||||
"description": "Alunos com faltas seguidas, que pararam de vir ou cuja presença está caindo.",
|
||||
"emptyTitle": "Nenhum aluno em risco!",
|
||||
"emptyDescription": "Não há faltas consecutivas nem presença abaixo de 50%.",
|
||||
"noPhone": "Sem telefone",
|
||||
"monthlyRate": "{{rate}}% de presença no mês",
|
||||
"reengage": "Reengajar pelo WhatsApp",
|
||||
"manage": "Gerenciar vaga",
|
||||
"pause": "Pausar vaga",
|
||||
"drop": "Dar baixa",
|
||||
"reasonStreak": "{{count}} faltas seguidas",
|
||||
"reasonDays_one": "{{count}} dia sem vir",
|
||||
"reasonDays_other": "{{count}} dias sem vir",
|
||||
"reasonTrend": "Presença em queda",
|
||||
"reengageMessage": "Olá, {{name}}! 👋 Sentimos sua falta em {{group}}. Percebemos que você não veio às últimas aulas e queremos que você volte. Se tiver algum problema com horários ou com a mensalidade, fale com a gente e resolvemos juntos.",
|
||||
"yourClass": "sua aula",
|
||||
"openingWhatsapp": "Abrindo o WhatsApp! Mensagem copiada."
|
||||
},
|
||||
"status": {
|
||||
"dropTitle": "Dar baixa",
|
||||
"pauseTitle": "Pausar vaga",
|
||||
"dropBody": "{{name}} vai deixar de frequentar <strong>{{group}}</strong>. A vaga ficará <strong>disponível</strong> para outro aluno e o histórico de presença será mantido.",
|
||||
"pauseBody": "{{name}} ficará <strong>pausado</strong> em <strong>{{group}}</strong>. A vaga fica <strong>livre</strong> e você pode reativá-la quando quiser.",
|
||||
"dropped": "{{name}} saiu do grupo. A vaga ficou disponível.",
|
||||
"paused": "A vaga de {{name}} foi pausada.",
|
||||
"error": "Não conseguimos atualizar o status do aluno."
|
||||
},
|
||||
"history": {
|
||||
"title": "Histórico",
|
||||
"description": "Histórico de presença das últimas aulas.",
|
||||
"error": "Não conseguimos carregar o histórico deste aluno.",
|
||||
"overall_one": "Presença geral ({{count}} aula)",
|
||||
"overall_other": "Presença geral ({{count}} aulas)"
|
||||
}
|
||||
}
|
||||
@@ -38,5 +38,24 @@
|
||||
"tomorrow": "Amanhã · {{time}}",
|
||||
"other": "{{date}} · {{time}}"
|
||||
},
|
||||
"billingDueDay": "Vence todo dia {{day}}"
|
||||
"billingDueDay": "Vence todo dia {{day}}",
|
||||
"weekDayShort": {
|
||||
"MONDAY": "Seg",
|
||||
"TUESDAY": "Ter",
|
||||
"WEDNESDAY": "Qua",
|
||||
"THURSDAY": "Qui",
|
||||
"FRIDAY": "Sex",
|
||||
"SATURDAY": "Sáb",
|
||||
"SUNDAY": "Dom"
|
||||
},
|
||||
"billingTypeHint": {
|
||||
"MONTHLY": "Uma cobrança por mês",
|
||||
"PER_CLASS": "Cada aula que frequentar"
|
||||
},
|
||||
"attendanceStatus": {
|
||||
"PRESENT": "Presente",
|
||||
"ABSENT": "Ausente",
|
||||
"EXCUSED": "Avisou falta",
|
||||
"NONE": "Sem registro"
|
||||
}
|
||||
}
|
||||
|
||||
97
apps/web/src/i18n/locales/pt-BR/groupAdd.json
Normal file
97
apps/web/src/i18n/locales/pt-BR/groupAdd.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"back": "Voltar ao grupo",
|
||||
"title": "Adicionar membros",
|
||||
"subtitleGroup": "Adicione membros a <strong>{{group}}</strong> individualmente ou em massa a partir de uma lista.",
|
||||
"subtitle": "Adicione membros individualmente ou em massa a partir de uma lista.",
|
||||
"occupancy": "{{count}} de {{capacity}} vagas ocupadas.",
|
||||
"tabs": {
|
||||
"quick": "Cadastro rápido (individual)",
|
||||
"bulk": "Cadastro em massa (CSV / Excel)"
|
||||
},
|
||||
"quick": {
|
||||
"firstName": "Nome",
|
||||
"firstNamePlaceholder": "Ex.: Lucas",
|
||||
"lastName": "Sobrenome",
|
||||
"lastNamePlaceholder": "Ex.: Souza",
|
||||
"phone": "Telefone / WhatsApp",
|
||||
"phonePlaceholder": "Ex.: +55 11 91234-5678",
|
||||
"phoneHint": "Usado para contato e para detectar duplicados.",
|
||||
"email": "E-mail (opcional)",
|
||||
"emailPlaceholder": "aluno@exemplo.com",
|
||||
"notes": "Observações (opcional)",
|
||||
"notesPlaceholder": "Ex.: Nível intermediário, traz o próprio material",
|
||||
"submit": "Salvar membro",
|
||||
"mustLink": "Esse telefone já é de uma pessoa cadastrada: adicione-a ou use outro telefone.",
|
||||
"required": "Nome e telefone são obrigatórios."
|
||||
},
|
||||
"existing": {
|
||||
"alreadyInGroup": "{{name}} já é membro deste grupo.",
|
||||
"linked": "Você vai adicionar <strong>{{name}}</strong> a este grupo. Os dados de contato e observações são os mesmos dos outros grupos.",
|
||||
"found": "Você já tem <strong>{{name}}</strong> com este telefone. É a mesma pessoa?",
|
||||
"foundInGroups": "Você já tem <strong>{{name}}</strong> com este telefone (em {{groups}}). É a mesma pessoa?",
|
||||
"notThisPerson": "Não é esta pessoa",
|
||||
"otherPhone": "Usar outro telefone",
|
||||
"confirm": "Sim, adicionar"
|
||||
},
|
||||
"capacity": {
|
||||
"title": "Vagas esgotadas",
|
||||
"description": "O grupo atingiu o limite máximo de membros.",
|
||||
"body": "O grupo <strong>{{group}}</strong> já atingiu o limite de <strong>{{capacity}}</strong> membros. O que você quer fazer com <strong>{{name}}</strong>?",
|
||||
"force": "Adicionar mesmo assim",
|
||||
"waitlist": "Colocar na lista de espera",
|
||||
"forceHint": "Se adicionar mesmo assim, o grupo ficará acima do limite de vagas."
|
||||
},
|
||||
"bulkCapacity": {
|
||||
"title": "Aviso de vagas",
|
||||
"description": "A importação ultrapassa as vagas do grupo.",
|
||||
"body": "Você vai importar <strong>{{rows}}</strong> membro(s), mas o grupo já tem <strong>{{current}}</strong> inscrito(s) e o limite é <strong>{{capacity}}</strong>. Quer importar mesmo assim?",
|
||||
"confirm": "Importar mesmo assim"
|
||||
},
|
||||
"bulk": {
|
||||
"unsupported": "Formato não suportado. Envie um arquivo .csv ou .xlsx",
|
||||
"noContacts": "Nenhum contato encontrado no arquivo.",
|
||||
"detected": "Encontramos {{count}} linhas ({{valid}} válidas).",
|
||||
"processError": "Erro ao processar o arquivo.",
|
||||
"dropzone": "Arraste seu arquivo aqui ou toque para escolher",
|
||||
"formats": "Formatos: CSV (.csv) ou Excel (.xlsx)",
|
||||
"templateHint": "Não tem o arquivo pronto? Use nosso modelo.",
|
||||
"downloadTemplate": "Baixar modelo CSV",
|
||||
"parsing": "Lendo e analisando o arquivo...",
|
||||
"preview": "Prévia:",
|
||||
"ready": "{{count}} prontos para importar",
|
||||
"withErrors": "{{count}} com erros",
|
||||
"clear": "Limpar lista",
|
||||
"name": "Nome",
|
||||
"phone": "Telefone",
|
||||
"email": "E-mail",
|
||||
"status": "Status",
|
||||
"noName": "Sem nome",
|
||||
"noPhone": "Sem telefone",
|
||||
"valid": "Válido",
|
||||
"removeRow": "Remover linha",
|
||||
"confirm": "Confirmar e importar ({{count}})",
|
||||
"missingName": "Falta o nome",
|
||||
"invalidPhone": "Telefone inválido ou ausente",
|
||||
"noSheet": "Não encontramos a planilha principal no arquivo Excel.",
|
||||
"noValidRows": "Não há membros válidos para importar."
|
||||
},
|
||||
"template": {
|
||||
"fileName": "modelo_alunos_gruperly.csv",
|
||||
"header": "Nome,Sobrenome,Telefone,Email,Observações",
|
||||
"rows": "Sofia,Rodrigues,+5511912345678,sofia@exemplo.com,Nível intermediário\nLucas,Souza,+5511923456789,lucas@exemplo.com,Traz instrumento\nValentina,Moraes,+5511934567890,,"
|
||||
},
|
||||
"toast": {
|
||||
"created": "{{name}} foi adicionado ao grupo.",
|
||||
"waitlisted": "{{name}} entrou na lista de espera do grupo.",
|
||||
"personExists": "Você já tem uma pessoa cadastrada com este telefone. Pode adicioná-la a este grupo.",
|
||||
"addError": "Não foi possível adicionar o membro.",
|
||||
"alreadyWaitlisted": "Este número já está na lista de espera do grupo.",
|
||||
"waitlistError": "Não foi possível colocar na lista de espera.",
|
||||
"importError": "Não foi possível importar os membros.",
|
||||
"imported_one": "{{count}} aluno adicionado.",
|
||||
"imported_other": "{{count}} alunos adicionados.",
|
||||
"importedLinked": "{{count}} já estavam em outros grupos seus.",
|
||||
"importedDuplicates_one": "{{count}} duplicado ignorado.",
|
||||
"importedDuplicates_other": "{{count}} duplicados ignorados."
|
||||
}
|
||||
}
|
||||
199
apps/web/src/i18n/locales/pt-BR/groupDetail.json
Normal file
199
apps/web/src/i18n/locales/pt-BR/groupDetail.json
Normal file
@@ -0,0 +1,199 @@
|
||||
{
|
||||
"fallbackTitle": "Grupo",
|
||||
"header": {
|
||||
"backToGroups": "Voltar para grupos",
|
||||
"active": "Ativo",
|
||||
"addMember": "Adicionar membro",
|
||||
"stats": "Estatísticas",
|
||||
"charge": "Cobrar",
|
||||
"chargeNoPrice": "Defina o preço do grupo para poder cobrar",
|
||||
"share": "Compartilhar"
|
||||
},
|
||||
"notFound": {
|
||||
"title": "Grupo não encontrado",
|
||||
"description": "Não foi possível carregar as informações deste grupo.",
|
||||
"back": "Voltar para Grupos"
|
||||
},
|
||||
"info": {
|
||||
"schedule": "Horário",
|
||||
"noSchedule": "Sem horário definido",
|
||||
"membersCapacity": "Membros e vagas",
|
||||
"occupancy": "Ocupação das vagas",
|
||||
"occupancyValue": "{{count}} de {{capacity}}",
|
||||
"noCapacity": "Sem limite de vagas",
|
||||
"full": "Vagas esgotadas",
|
||||
"freeSpots_one": "{{count}} vaga livre",
|
||||
"freeSpots_other": "{{count}} vagas livres",
|
||||
"waiting": " · {{count}} na espera",
|
||||
"billing": "Cobrança",
|
||||
"noPrice": "Sem preço"
|
||||
},
|
||||
"sections": {
|
||||
"label": "Lista do grupo",
|
||||
"members": "Membros",
|
||||
"pending": "Pendentes",
|
||||
"searchPlaceholder": "Buscar por nome ou telefone...",
|
||||
"searchLabel": "Buscar na lista",
|
||||
"pendingHint": "Pré-inscrições aguardando sua aprovação e pessoas na lista de espera por uma vaga."
|
||||
},
|
||||
"members": {
|
||||
"overdueFilter": "{{count}} com pagamento vencido",
|
||||
"emptyTitle": "Ainda não há membros neste grupo",
|
||||
"emptyDescription": "Você pode compartilhar o link de convite ou adicionar membros manualmente ou em massa.",
|
||||
"shareLink": "Compartilhar link",
|
||||
"addMembers": "Adicionar membros",
|
||||
"noOverdueMatch": "Nenhum membro com pagamento vencido corresponde à busca.",
|
||||
"noMatch": "Nenhum membro corresponde à busca.",
|
||||
"classDot": "Aula {{index}} de {{total}}: {{status}}"
|
||||
},
|
||||
"row": {
|
||||
"settled": "Em dia",
|
||||
"dueToday": "Vence hoje",
|
||||
"dueTomorrow": "Vence amanhã",
|
||||
"dueIn": "Vence em {{days}} d",
|
||||
"overdue": "Vencido · {{days}} d",
|
||||
"noClasses": "Sem aulas ainda",
|
||||
"attended_one": "{{attended}} de {{count}} aula",
|
||||
"attended_other": "{{attended}} de {{count}} aulas"
|
||||
},
|
||||
"pending": {
|
||||
"emptyTitle": "Nada pendente",
|
||||
"emptyDescription": "As pré-inscrições que chegarem pelo link compartilhado e as pessoas na lista de espera vão aparecer aqui para você revisar.",
|
||||
"noMatch": "Nenhum pendente corresponde à busca.",
|
||||
"preRegistrations": "Pré-inscrições",
|
||||
"preRegistrationsEmpty": "Nenhuma pré-inscrição pendente.",
|
||||
"waitlist": "Lista de espera",
|
||||
"waitlistEmpty": "Ninguém na lista de espera."
|
||||
},
|
||||
"table": {
|
||||
"name": "Nome",
|
||||
"phone": "Telefone",
|
||||
"requested": "Solicitado",
|
||||
"detail": "Detalhe"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Compartilhar link de convite",
|
||||
"description": "Envie este link aos seus membros para que preencham os dados e façam a pré-inscrição no grupo.",
|
||||
"linkLabel": "Link único do grupo",
|
||||
"copy": "Copiar",
|
||||
"copyTitle": "Copiar para a área de transferência",
|
||||
"previewTitle": "Prévia da mensagem para o WhatsApp:",
|
||||
"copyMessage": "Copiar mensagem",
|
||||
"copyMessageTitle": "Copiar a mensagem completa",
|
||||
"message": "Olá! 👋 Convido você a participar do grupo *{{group}}*.\n\nFaça sua pré-inscrição neste link. O professor vai revisar seu pedido:\n{{url}}",
|
||||
"messagePreview": "Olá! 👋 Convido você a participar do grupo <strong>{{group}}</strong>.\n\nFaça sua pré-inscrição neste link. O professor vai revisar seu pedido:\n",
|
||||
"openWhatsapp": "Abrir no WhatsApp",
|
||||
"regenerate": "Gerar novo link",
|
||||
"regenerateTitle": "Invalida o link anterior e gera um novo",
|
||||
"footnote": "Ao tocar em <strong>Abrir no WhatsApp</strong>, a mensagem completa é copiada. Se o WhatsApp Web carregar só o link, cole com <kbd>Ctrl+V</kbd> ou <kbd>Cmd+V</kbd>.",
|
||||
"regenerated": "Um novo link de convite foi gerado.",
|
||||
"regenerateError": "Não foi possível gerar um novo link de convite.",
|
||||
"linkCopied": "Link de convite copiado!",
|
||||
"messageCopied": "Mensagem copiada!",
|
||||
"copyError": "Não foi possível copiar automaticamente. Copie o texto manualmente.",
|
||||
"openingWhatsapp": "Abrindo o WhatsApp! Mensagem copiada."
|
||||
},
|
||||
"remove": {
|
||||
"title": "Remover do grupo",
|
||||
"body": "{{name}} vai deixar de ser membro do grupo <strong>{{group}}</strong>.",
|
||||
"bodyFreeSpot": "{{name}} vai deixar de ser membro do grupo <strong>{{group}}</strong> e a vaga ficará livre.",
|
||||
"phone": "Telefone: {{phone}}",
|
||||
"waiting_one": "Há {{count}} pessoa esperando uma vaga",
|
||||
"waiting_other": "Há {{count}} pessoas esperando uma vaga",
|
||||
"promoteQuestion": "Quer passar <strong>{{name}}</strong>, primeiro da lista de espera, para o grupo?",
|
||||
"removeAndPromote": "Remover e passar {{name}} para o grupo",
|
||||
"removeOnly": "Só remover do grupo",
|
||||
"confirm": "Remover do grupo",
|
||||
"removed": "{{name}} saiu do grupo.",
|
||||
"removedPromoted": "{{name}} saiu do grupo e {{promoted}} passou da lista de espera para o grupo.",
|
||||
"hasPayments": "Este membro tem cobranças associadas.",
|
||||
"error": "Não foi possível remover o membro do grupo."
|
||||
},
|
||||
"preRegistration": {
|
||||
"title": "Detalhe da pré-inscrição",
|
||||
"requestedOn": "Solicitado em {{date}}",
|
||||
"phone": "Telefone",
|
||||
"email": "E-mail",
|
||||
"fullWarning": "O grupo atingiu o limite de vagas. Se você aprovar, esta pessoa ficará na lista de espera até liberar uma vaga.",
|
||||
"approve": "Aprovar",
|
||||
"reject": "Recusar",
|
||||
"added": "{{name}} agora é membro do grupo.",
|
||||
"waitlisted": "{{name}} entrou na lista de espera: o grupo está lotado.",
|
||||
"alreadyRegistered": "Já existe um membro com esse telefone no grupo. Você pode recusar a pré-inscrição.",
|
||||
"alreadyReviewed": "Esta pré-inscrição já foi revisada.",
|
||||
"approveError": "Não foi possível aprovar a pré-inscrição.",
|
||||
"rejected": "A pré-inscrição de {{name}} foi recusada.",
|
||||
"rejectError": "Não foi possível recusar a pré-inscrição."
|
||||
},
|
||||
"waitlistEntry": {
|
||||
"title": "Detalhe da lista de espera",
|
||||
"since": "Na espera desde {{date}}",
|
||||
"phone": "Telefone",
|
||||
"noPhone": "Sem telefone",
|
||||
"email": "E-mail",
|
||||
"notes": "Observações",
|
||||
"noNotes": "Sem observações",
|
||||
"assignTo": "Atribuir a",
|
||||
"ownGroup": "{{name}} (onde se inscreveu)",
|
||||
"fullGroup": "{{name}} (sem vagas)",
|
||||
"currentFull": "O grupo atingiu o limite de vagas. Remova um membro ou aumente as vagas para passar esta pessoa para o grupo.",
|
||||
"targetFull": "Esse grupo atingiu o limite de vagas. Escolha outro grupo ou libere uma vaga primeiro.",
|
||||
"promote": "Passar para o grupo",
|
||||
"promoteTo": "Passar para {{group}}",
|
||||
"remove": "Remover da lista de espera",
|
||||
"promoted": "{{name}} passou da lista de espera para o grupo.",
|
||||
"promotedTo": "{{name}} passou para {{group}}.",
|
||||
"otherGroup": "outro grupo",
|
||||
"capacityReached": "O grupo atingiu o limite de vagas. Remova um membro ou aumente as vagas primeiro.",
|
||||
"promoteError": "Não foi possível passar o membro para o grupo.",
|
||||
"removed": "{{name}} saiu da lista de espera.",
|
||||
"removeError": "Não foi possível remover da lista de espera."
|
||||
},
|
||||
"charge": {
|
||||
"title": "Cobrar período",
|
||||
"description": "Links de pagamento para {{group}}",
|
||||
"notConnected": "Para criar links de pagamento, primeiro vincule sua conta do Mercado Pago.",
|
||||
"connect": "Conectar Mercado Pago",
|
||||
"created": "{{linked}} de {{total}} links criados",
|
||||
"notGenerated": "Não gerado",
|
||||
"copied": "Copiado",
|
||||
"copyLink": "Copiar link",
|
||||
"failedNote": "Os que não foram gerados ficaram salvos: você poderá criar o link em Cobranças sem cobrar nada a mais do aluno.",
|
||||
"done": "Pronto",
|
||||
"fee": "Mensalidade do grupo",
|
||||
"dueDate": "Vencimento",
|
||||
"period": "Período ou referência",
|
||||
"periodPlaceholder": "Ex.: Outubro 2026",
|
||||
"submit": "Criar links de pagamento",
|
||||
"mpNotConnected": "Sua conta do Mercado Pago não está vinculada.",
|
||||
"noPrice": "Este grupo ainda não tem preço.",
|
||||
"noAttendees": "Não há membros ativos para cobrar.",
|
||||
"error": "Não conseguimos criar as cobranças."
|
||||
},
|
||||
"automations": {
|
||||
"title": "Mensagens automáticas",
|
||||
"summaryOff": "Desligadas",
|
||||
"summary_one": "{{count}} ativa",
|
||||
"summary_other": "{{count}} ativas",
|
||||
"channel": "WhatsApp · {{summary}}",
|
||||
"proOnly": "Disponível no plano Pro.",
|
||||
"seePlans": "Ver planos",
|
||||
"goToSettings": "Ir para Ajustes",
|
||||
"paymentReminderTitle": "Lembrete semanal de pagamento",
|
||||
"paymentReminderDescription": "Para quem tiver uma cobrança pendente ou vencida, com o link de pagamento.",
|
||||
"reengagementTitle": "Mensagem semanal de reengajamento",
|
||||
"reengagementDescription": "Para membros em risco por faltas. No máximo uma a cada 2 semanas.",
|
||||
"saved": "Salvamos as mensagens automáticas do grupo.",
|
||||
"saveError": "Não foi possível salvar as mensagens automáticas."
|
||||
},
|
||||
"absenceNotices": {
|
||||
"title": "Faltas avisadas · esta semana",
|
||||
"excused": "Justificada",
|
||||
"reason": {
|
||||
"health": "Saúde",
|
||||
"travel": "Viagem",
|
||||
"work_study": "Trabalho ou estudo",
|
||||
"other": "Outro"
|
||||
}
|
||||
}
|
||||
}
|
||||
68
apps/web/src/i18n/locales/pt-BR/groups.json
Normal file
68
apps/web/src/i18n/locales/pt-BR/groups.json
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"title": "Grupos",
|
||||
"loading": "Carregando grupos",
|
||||
"loadError": "Não conseguimos carregar seus grupos.",
|
||||
"empty": {
|
||||
"title": "Você ainda não tem grupos",
|
||||
"description": "Crie seu primeiro grupo e comece a cobrar as mensalidades dos seus alunos.",
|
||||
"cta": "Criar primeiro grupo"
|
||||
},
|
||||
"myGroups": "Meus grupos",
|
||||
"newGroup": "Novo grupo",
|
||||
"attentionPreview": {
|
||||
"title": "Precisa de atenção",
|
||||
"students_one": "{{count}} aluno",
|
||||
"students_other": "{{count}} alunos",
|
||||
"seeAll": "Ver todos",
|
||||
"urgent": "Urgente:",
|
||||
"watch": "Atenção:"
|
||||
},
|
||||
"card": {
|
||||
"atRisk": "{{count}} em risco",
|
||||
"free_one": "{{count}} vaga",
|
||||
"free_other": "{{count}} vagas",
|
||||
"full": "Lotado",
|
||||
"students_one": "{{count}} aluno",
|
||||
"students_other": "{{count}} alunos",
|
||||
"occupancy": "{{count}} de {{capacity}} vagas ocupadas"
|
||||
},
|
||||
"summary": {
|
||||
"groups_one": "{{count}} grupo",
|
||||
"groups_other": "{{count}} grupos",
|
||||
"students_one": "{{count}} aluno",
|
||||
"students_other": "{{count}} alunos",
|
||||
"freeSpots_one": "{{count}} vaga livre",
|
||||
"freeSpots_other": "{{count}} vagas livres"
|
||||
},
|
||||
"absence": {
|
||||
"streak": "{{count}} faltas",
|
||||
"daysAway_one": "{{count}} dia sem vir",
|
||||
"daysAway_other": "{{count}} dias sem vir",
|
||||
"single": "1 falta",
|
||||
"rate": "presença de {{rate}}%"
|
||||
},
|
||||
"risk": {
|
||||
"HIGH": "Risco alto",
|
||||
"MEDIUM": "Risco moderado",
|
||||
"hint": "Risco de evasão: probabilidade estimada de algum membro deixar o grupo."
|
||||
},
|
||||
"create": {
|
||||
"heading": "Novo grupo",
|
||||
"description": "Defina os dados da aula que você vai cobrar. Depois você pode editá-los quando quiser.",
|
||||
"submit": "Criar grupo",
|
||||
"error": "Não conseguimos criar o grupo. Revise os dados e tente novamente."
|
||||
},
|
||||
"form": {
|
||||
"name": "Nome do grupo",
|
||||
"namePlaceholder": "Ex.: Yoga Vinyasa · Nível 1",
|
||||
"days": "Dias de aula",
|
||||
"time": "Horário",
|
||||
"capacity": "Vagas",
|
||||
"price": "Preço",
|
||||
"pricePlaceholder": "Por aluno",
|
||||
"billingType": "Tipo de cobrança",
|
||||
"dueDay": "Dia de vencimento",
|
||||
"dueDayHint": "As cobranças vencerão todo dia {{day}}.",
|
||||
"submitting": "Criando…"
|
||||
}
|
||||
}
|
||||
@@ -48,5 +48,14 @@
|
||||
},
|
||||
"payment": {
|
||||
"descriptionMax": "A descrição é muito longa"
|
||||
},
|
||||
"lastName": {
|
||||
"required": "O sobrenome é obrigatório"
|
||||
},
|
||||
"bulk": {
|
||||
"empty": "Envie pelo menos um aluno"
|
||||
},
|
||||
"attendance": {
|
||||
"empty": "Envie pelo menos um registro de presença"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { i18n } from '../i18n/instance';
|
||||
|
||||
export type ParsedContactRow = {
|
||||
id: string;
|
||||
firstName: string;
|
||||
@@ -141,7 +143,7 @@ export async function parseXlsxContent(buffer: ArrayBuffer): Promise<string[][]>
|
||||
// Parse sheet1.xml
|
||||
const sheetData = entries.get('xl/worksheets/sheet1.xml');
|
||||
if (!sheetData) {
|
||||
throw new Error('No se pudo encontrar la hoja de cálculo principal en el archivo Excel.');
|
||||
throw new Error(i18n.t('groupAdd:bulk.noSheet'));
|
||||
}
|
||||
|
||||
const sheetXml = new TextDecoder().decode(sheetData);
|
||||
@@ -191,13 +193,15 @@ export function normalizeRowsToContacts(rawRows: string[][]): ParsedContactRow[]
|
||||
|
||||
for (let i = 0; i < headerRow.length; i++) {
|
||||
const col = headerRow[i];
|
||||
if (col === 'nombre' || col === 'first name' || col === 'firstname') {
|
||||
if (col === 'nombre' || col === 'nome' || col === 'first name' || col === 'firstname') {
|
||||
firstNameCol = i;
|
||||
hasHeader = true;
|
||||
} else if (col === 'apellido' || col === 'last name' || col === 'lastname') {
|
||||
} else if (col === 'apellido' || col === 'sobrenome' || col === 'last name' || col === 'lastname') {
|
||||
lastNameCol = i;
|
||||
hasHeader = true;
|
||||
} else if (col === 'nombre completo' || col === 'full name' || col === 'fullname' || col === 'alumno') {
|
||||
} else if (
|
||||
['nombre completo', 'nome completo', 'full name', 'fullname', 'alumno', 'aluno', 'student'].includes(col)
|
||||
) {
|
||||
nameCol = i;
|
||||
hasHeader = true;
|
||||
} else if (
|
||||
@@ -213,7 +217,7 @@ export function normalizeRowsToContacts(rawRows: string[][]): ParsedContactRow[]
|
||||
} else if (col.includes('email') || col.includes('correo')) {
|
||||
emailCol = i;
|
||||
hasHeader = true;
|
||||
} else if (col.includes('nota') || col.includes('obs')) {
|
||||
} else if (col.includes('nota') || col.includes('note') || col.includes('obs')) {
|
||||
notesCol = i;
|
||||
hasHeader = true;
|
||||
}
|
||||
@@ -269,9 +273,9 @@ export function normalizeRowsToContacts(rawRows: string[][]): ParsedContactRow[]
|
||||
const notes = (notesCol !== -1 ? row[notesCol] : '') || '';
|
||||
|
||||
const errors: string[] = [];
|
||||
if (!firstName && !fullName) errors.push('Falta el nombre');
|
||||
if (!firstName && !fullName) errors.push(i18n.t('groupAdd:bulk.missingName'));
|
||||
if (!phone || phone.replace(/\D/g, '').length < 6) {
|
||||
errors.push('Teléfono inválido o faltante');
|
||||
errors.push(i18n.t('groupAdd:bulk.invalidPhone'));
|
||||
}
|
||||
|
||||
contacts.push({
|
||||
@@ -294,11 +298,10 @@ export function normalizeRowsToContacts(rawRows: string[][]): ParsedContactRow[]
|
||||
* Downloads a sample template in CSV format for the bulk upload.
|
||||
*/
|
||||
export function downloadAttendeeTemplateCsv() {
|
||||
// The template follows the UI language; the parser accepts the headers of
|
||||
// every supported language.
|
||||
const csvContent =
|
||||
'Nombre,Apellido,Teléfono,Email,Notas\r\n' +
|
||||
'Sofía,Rodríguez,+5491144556677,sofia@ejemplo.com,Nivel intermedio\r\n' +
|
||||
'Lucas,Benítez,+5491155667788,lucas@ejemplo.com,Trae instrumento\r\n' +
|
||||
'Valentina,Morales,+5491166778899,,\r\n';
|
||||
[i18n.t('groupAdd:template.header'), ...i18n.t('groupAdd:template.rows').split('\n')].join('\r\n') + '\r\n';
|
||||
|
||||
const blob = new Blob([new Uint8Array([0xef, 0xbb, 0xbf]), csvContent], {
|
||||
type: 'text/csv;charset=utf-8;',
|
||||
@@ -306,7 +309,7 @@ export function downloadAttendeeTemplateCsv() {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.setAttribute('href', url);
|
||||
link.setAttribute('download', 'plantilla_alumnos_gruperly.csv');
|
||||
link.setAttribute('download', i18n.t('groupAdd:template.fileName'));
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
Reference in New Issue
Block a user