feat(i18n): traducir el backoffice
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,8 @@ import { useQuery } from '@tanstack/react-query'
|
|||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
import { createContext, useContext } from 'react'
|
import { createContext, useContext } from 'react'
|
||||||
import { ApiError, getAdminAccount } from '../../lib/api'
|
import { ApiError, getAdminAccount } from '../../lib/api'
|
||||||
|
import { errorMessage as apiErrorMessage } from '../../i18n'
|
||||||
|
import { i18n } from '../../i18n/instance'
|
||||||
|
|
||||||
type AdminAccountDetailContextValue = {
|
type AdminAccountDetailContextValue = {
|
||||||
account: AdminAccountDetail | null
|
account: AdminAccountDetail | null
|
||||||
@@ -30,9 +32,7 @@ export function AdminAccountDetailProvider({
|
|||||||
const error = accountQuery.error
|
const error = accountQuery.error
|
||||||
const isNotFound = error instanceof ApiError && error.status === 404
|
const isNotFound = error instanceof ApiError && error.status === 404
|
||||||
const errorMessage = accountQuery.isError
|
const errorMessage = accountQuery.isError
|
||||||
? error instanceof ApiError
|
? apiErrorMessage(error, i18n.t('admin:detail.loadError'))
|
||||||
? (error.problem?.detail ?? 'No pudimos cargar la cuenta.')
|
|
||||||
: 'No pudimos cargar la cuenta.'
|
|
||||||
: null
|
: null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -9,15 +9,17 @@ import { BILLING_PROVIDER_NAMES, formatBillingDate, formatUsage, subscriptionSta
|
|||||||
import { useAdminAccountDetail } from './AdminAccountDetailProvider'
|
import { useAdminAccountDetail } from './AdminAccountDetailProvider'
|
||||||
import {
|
import {
|
||||||
countryLabel,
|
countryLabel,
|
||||||
MP_STATUS_LABELS,
|
mpStatusLabel,
|
||||||
planLabel,
|
planLabel,
|
||||||
planVariant,
|
planVariant,
|
||||||
subscriptionVariant,
|
subscriptionVariant,
|
||||||
WHATSAPP_STATUS_LABELS,
|
whatsappStatusLabel,
|
||||||
} from './copy'
|
} from './copy'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
export function AdminAccountDetailView() {
|
export function AdminAccountDetailView() {
|
||||||
const { account, isPending, isError, isNotFound, errorMessage, retry } = useAdminAccountDetail()
|
const { account, isPending, isError, isNotFound, errorMessage, retry } = useAdminAccountDetail()
|
||||||
|
const { t } = useTranslation(['admin', 'common', 'billing'])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
@@ -26,26 +28,26 @@ export function AdminAccountDetailView() {
|
|||||||
className="hidden items-center gap-1.5 text-sm font-medium text-foreground/60 hover:text-primary lg:inline-flex"
|
className="hidden items-center gap-1.5 text-sm font-medium text-foreground/60 hover:text-primary lg:inline-flex"
|
||||||
>
|
>
|
||||||
<ArrowLeft className="size-4" aria-hidden="true" />
|
<ArrowLeft className="size-4" aria-hidden="true" />
|
||||||
Cuentas
|
{t('accounts')}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{/* El h1 va siempre, también cargando, para que el layout no salte. */}
|
{/* El h1 va siempre, también cargando, para que el layout no salte. */}
|
||||||
<h1 className="mt-2 truncate text-2xl font-bold text-primary">{account?.name ?? 'Cuenta'}</h1>
|
<h1 className="mt-2 truncate text-2xl font-bold text-primary">{account?.name ?? t('detail.fallback')}</h1>
|
||||||
{account ? <p className="mt-0.5 truncate text-sm text-foreground/60">{account.email}</p> : null}
|
{account ? <p className="mt-0.5 truncate text-sm text-foreground/60">{account.email}</p> : null}
|
||||||
|
|
||||||
{isPending ? (
|
{isPending ? (
|
||||||
<div className="mt-8 flex items-center justify-center py-16" role="status">
|
<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" />
|
<Loader2 className="size-6 animate-spin text-secondary/50" aria-hidden="true" />
|
||||||
<span className="sr-only">Cargando cuenta</span>
|
<span className="sr-only">{t('detail.loading')}</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{isError ? (
|
{isError ? (
|
||||||
<div className="mt-8 space-y-3 rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger">
|
<div className="mt-8 space-y-3 rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger">
|
||||||
<p>{isNotFound ? 'Esta cuenta no existe.' : errorMessage}</p>
|
<p>{isNotFound ? t('detail.notFound') : errorMessage}</p>
|
||||||
{isNotFound ? null : (
|
{isNotFound ? null : (
|
||||||
<Button variant="outline" size="sm" onClick={retry}>
|
<Button variant="outline" size="sm" onClick={retry}>
|
||||||
Reintentar
|
{t('common:actions.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -59,65 +61,69 @@ export function AdminAccountDetailView() {
|
|||||||
function AccountDetail({ account }: { account: AdminAccountDetail }) {
|
function AccountDetail({ account }: { account: AdminAccountDetail }) {
|
||||||
const subscription = account.subscription
|
const subscription = account.subscription
|
||||||
const limits = PLAN_LIMITS[account.plan ?? 'FREE']
|
const limits = PLAN_LIMITS[account.plan ?? 'FREE']
|
||||||
|
const { t } = useTranslation(['admin', 'common', 'billing'])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mt-6 grid gap-4 lg:grid-cols-2">
|
<div className="mt-6 grid gap-4 lg:grid-cols-2">
|
||||||
<Card title="Cuenta">
|
<Card title={t('detail.account')}>
|
||||||
<Field label="País">{countryLabel(account.country)}</Field>
|
<Field label={t('detail.country')}>{countryLabel(account.country)}</Field>
|
||||||
<Field label="Alta">{formatBillingDate(account.createdAt)}</Field>
|
<Field label={t('detail.createdAt')}>{formatBillingDate(account.createdAt)}</Field>
|
||||||
<Field label="Onboarding">{account.onboardingCompleted ? 'Completo' : 'Sin terminar'}</Field>
|
<Field label={t('detail.onboarding')}>
|
||||||
<Field label="Mercado Pago">{MP_STATUS_LABELS[account.mpStatus ?? 'NONE']}</Field>
|
{account.onboardingCompleted ? t('detail.onboardingDone') : t('detail.onboardingPending')}
|
||||||
<Field label="WhatsApp">{WHATSAPP_STATUS_LABELS[account.whatsappStatus ?? 'NONE']}</Field>
|
</Field>
|
||||||
|
<Field label="Mercado Pago">{mpStatusLabel(account.mpStatus)}</Field>
|
||||||
|
<Field label="WhatsApp">{whatsappStatusLabel(account.whatsappStatus)}</Field>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card title="Plan">
|
<Card title={t('detail.plan')}>
|
||||||
<Field label="Plan">
|
<Field label={t('detail.plan')}>
|
||||||
<span className="inline-flex flex-wrap items-center gap-1.5">
|
<span className="inline-flex flex-wrap items-center gap-1.5">
|
||||||
<Badge variant={planVariant(account.plan)}>{planLabel(account.plan)}</Badge>
|
<Badge variant={planVariant(account.plan)}>{planLabel(account.plan)}</Badge>
|
||||||
{account.readOnly ? <Badge variant="danger">Solo lectura</Badge> : null}
|
{account.readOnly ? <Badge variant="danger">{t('detail.readOnly')}</Badge> : null}
|
||||||
</span>
|
</span>
|
||||||
</Field>
|
</Field>
|
||||||
<Field label="Elegido el">{formatBillingDate(account.planSelectedAt) ?? '—'}</Field>
|
<Field label={t('detail.chosenOn')}>{formatBillingDate(account.planSelectedAt) ?? '—'}</Field>
|
||||||
<Field label="Suscripción">
|
<Field label={t('detail.subscription')}>
|
||||||
<Badge variant={subscriptionVariant(subscription?.status ?? null)}>
|
<Badge variant={subscriptionVariant(subscription?.status ?? null)}>
|
||||||
{subscriptionStatusLabel(subscription?.status ?? null)}
|
{subscriptionStatusLabel(subscription?.status ?? null)}
|
||||||
</Badge>
|
</Badge>
|
||||||
</Field>
|
</Field>
|
||||||
{subscription ? (
|
{subscription ? (
|
||||||
<>
|
<>
|
||||||
<Field label="Cobra">{BILLING_PROVIDER_NAMES[subscription.provider]}</Field>
|
<Field label={t('detail.provider')}>{BILLING_PROVIDER_NAMES[subscription.provider]}</Field>
|
||||||
<Field label="Precio">{formatPrice(subscription.amount, subscription.currency)} / mes</Field>
|
<Field label={t('detail.price')}>
|
||||||
<Field label="Pagado hasta">{formatBillingDate(subscription.paidThrough) ?? '—'}</Field>
|
{t('detail.perMonth', { price: formatPrice(subscription.amount, subscription.currency) })}
|
||||||
<Field label="Próximo cobro">{formatBillingDate(subscription.nextPaymentDate) ?? '—'}</Field>
|
</Field>
|
||||||
<Field label="Email de pago">{subscription.payerEmail}</Field>
|
<Field label={t('detail.paidThrough')}>{formatBillingDate(subscription.paidThrough) ?? '—'}</Field>
|
||||||
|
<Field label={t('detail.nextPayment')}>{formatBillingDate(subscription.nextPaymentDate) ?? '—'}</Field>
|
||||||
|
<Field label={t('detail.payerEmail')}>{subscription.payerEmail}</Field>
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{account.graceUntil ? (
|
{account.graceUntil ? (
|
||||||
<Field label="En gracia hasta">{formatBillingDate(account.graceUntil)}</Field>
|
<Field label={t('detail.graceUntil')}>{formatBillingDate(account.graceUntil)}</Field>
|
||||||
) : null}
|
) : null}
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card title="Uso">
|
<Card title={t('detail.usage')}>
|
||||||
<Field label="Grupos">{formatUsage(account.groupsCount, limits.maxGroups)}</Field>
|
<Field label={t('detail.groups')}>{formatUsage(account.groupsCount, limits.maxGroups)}</Field>
|
||||||
<Field label="Alumnos activos">{formatUsage(account.attendeesCount, limits.maxAttendees)}</Field>
|
<Field label={t('detail.students')}>{formatUsage(account.attendeesCount, limits.maxAttendees)}</Field>
|
||||||
{account.groups.length > 0 ? (
|
{account.groups.length > 0 ? (
|
||||||
<ul className="mt-2 divide-y divide-border border-t border-border">
|
<ul className="mt-2 divide-y divide-border border-t border-border">
|
||||||
{account.groups.map((group) => (
|
{account.groups.map((group) => (
|
||||||
<li key={group.id} className="flex items-center justify-between gap-3 py-2 text-sm">
|
<li key={group.id} className="flex items-center justify-between gap-3 py-2 text-sm">
|
||||||
<span className="min-w-0 truncate text-primary">{group.name}</span>
|
<span className="min-w-0 truncate text-primary">{group.name}</span>
|
||||||
<span className="shrink-0 text-xs text-foreground/60">
|
<span className="shrink-0 text-xs text-foreground/60">
|
||||||
{group.attendeesCount} {group.attendeesCount === 1 ? 'alumno' : 'alumnos'} · desde{' '}
|
{t('detail.groupLine', { count: group.attendeesCount, date: formatBillingDate(group.createdAt) })}
|
||||||
{formatBillingDate(group.createdAt)}
|
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
) : (
|
) : (
|
||||||
<p className="mt-2 text-sm text-foreground/60">Todavía no creó grupos.</p>
|
<p className="mt-2 text-sm text-foreground/60">{t('detail.noGroups')}</p>
|
||||||
)}
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card title="Cobros de Gruperly">
|
<Card title={t('detail.charges')}>
|
||||||
{account.charges.length > 0 ? (
|
{account.charges.length > 0 ? (
|
||||||
<ul className="divide-y divide-border">
|
<ul className="divide-y divide-border">
|
||||||
{account.charges.map((charge) => (
|
{account.charges.map((charge) => (
|
||||||
@@ -135,7 +141,7 @@ function AccountDetail({ account }: { account: AdminAccountDetail }) {
|
|||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-sm text-foreground/60">Sin cobros registrados.</p>
|
<p className="text-sm text-foreground/60">{t('detail.noCharges')}</p>
|
||||||
)}
|
)}
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { Badge } from '../../components/ui'
|
|||||||
import { formatPrice } from '../../lib/format'
|
import { formatPrice } from '../../lib/format'
|
||||||
import { formatBillingDate, subscriptionStatusLabel } from '../billing'
|
import { formatBillingDate, subscriptionStatusLabel } from '../billing'
|
||||||
import { countryLabel, planLabel, planVariant, subscriptionVariant } from './copy'
|
import { countryLabel, planLabel, planVariant, subscriptionVariant } from './copy'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
/** Columnas de la grilla en `lg+`; el encabezado de `AdminAccountsView` usa las mismas. */
|
/** Columnas de la grilla en `lg+`; el encabezado de `AdminAccountsView` usa las mismas. */
|
||||||
export const ACCOUNT_GRID_COLUMNS =
|
export const ACCOUNT_GRID_COLUMNS =
|
||||||
@@ -13,6 +14,7 @@ export const ACCOUNT_GRID_COLUMNS =
|
|||||||
/* Una cuenta de la lista: tarjeta en móvil, fila de la grilla en escritorio. */
|
/* Una cuenta de la lista: tarjeta en móvil, fila de la grilla en escritorio. */
|
||||||
export function AdminAccountRow({ account }: { account: AdminAccountListItem }) {
|
export function AdminAccountRow({ account }: { account: AdminAccountListItem }) {
|
||||||
const subscription = account.subscription
|
const subscription = account.subscription
|
||||||
|
const { t } = useTranslation(['admin', 'common', 'billing'])
|
||||||
const status = subscription?.status ?? null
|
const status = subscription?.status ?? null
|
||||||
const paidThrough = formatBillingDate(subscription?.paidThrough ?? null)
|
const paidThrough = formatBillingDate(subscription?.paidThrough ?? null)
|
||||||
const planBadge = <Badge variant={planVariant(account.plan)}>{planLabel(account.plan)}</Badge>
|
const planBadge = <Badge variant={planVariant(account.plan)}>{planLabel(account.plan)}</Badge>
|
||||||
@@ -39,9 +41,8 @@ export function AdminAccountRow({ account }: { account: AdminAccountListItem })
|
|||||||
{statusBadge}
|
{statusBadge}
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-2 text-xs text-foreground/60">
|
<p className="mt-2 text-xs text-foreground/60">
|
||||||
{countryLabel(account.country)} · {account.groupsCount}{' '}
|
{countryLabel(account.country)} · {t('row.groups', { count: account.groupsCount })} ·{' '}
|
||||||
{account.groupsCount === 1 ? 'grupo' : 'grupos'} · {account.attendeesCount}{' '}
|
{t('row.students', { count: account.attendeesCount })}
|
||||||
{account.attendeesCount === 1 ? 'alumno' : 'alumnos'}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -58,7 +59,7 @@ export function AdminAccountRow({ account }: { account: AdminAccountListItem })
|
|||||||
{subscription ? (
|
{subscription ? (
|
||||||
<p className="mt-1 truncate text-xs text-foreground/50">
|
<p className="mt-1 truncate text-xs text-foreground/50">
|
||||||
{formatPrice(subscription.amount, subscription.currency)}
|
{formatPrice(subscription.amount, subscription.currency)}
|
||||||
{paidThrough ? ` · hasta ${paidThrough}` : ''}
|
{paidThrough ? t('row.until', { date: paidThrough }) : ''}
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import { useQuery } from '@tanstack/react-query'
|
|||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
import { createContext, useContext, useEffect, useMemo, useState } from 'react'
|
import { createContext, useContext, useEffect, useMemo, useState } from 'react'
|
||||||
import { ApiError, getAdminAccounts } from '../../lib/api'
|
import { ApiError, getAdminAccounts } from '../../lib/api'
|
||||||
|
import { errorMessage as apiErrorMessage } from '../../i18n'
|
||||||
|
import { i18n } from '../../i18n/instance'
|
||||||
|
|
||||||
const PAGE_SIZE = 20
|
const PAGE_SIZE = 20
|
||||||
const SEARCH_DEBOUNCE_MS = 300
|
const SEARCH_DEBOUNCE_MS = 300
|
||||||
@@ -73,9 +75,7 @@ export function AdminAccountsProvider({ children }: { children: ReactNode }) {
|
|||||||
|
|
||||||
const data = accountsQuery.data
|
const data = accountsQuery.data
|
||||||
const errorMessage = accountsQuery.isError
|
const errorMessage = accountsQuery.isError
|
||||||
? accountsQuery.error instanceof ApiError
|
? apiErrorMessage(accountsQuery.error, i18n.t('admin:loadError'))
|
||||||
? (accountsQuery.error.problem?.detail ?? 'No pudimos cargar las cuentas.')
|
|
||||||
: 'No pudimos cargar las cuentas.'
|
|
||||||
: null
|
: null
|
||||||
|
|
||||||
// Cambiar un filtro vuelve a la primera página.
|
// Cambiar un filtro vuelve a la primera página.
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { Button, Input } from '../../components/ui'
|
|||||||
import { cn } from '../../lib/utils'
|
import { cn } from '../../lib/utils'
|
||||||
import { ACCOUNT_GRID_COLUMNS, AdminAccountRow } from './AdminAccountRow'
|
import { ACCOUNT_GRID_COLUMNS, AdminAccountRow } from './AdminAccountRow'
|
||||||
import { useAdminAccounts } from './AdminAccountsProvider'
|
import { useAdminAccounts } from './AdminAccountsProvider'
|
||||||
import { COUNTRY_OPTIONS, PLAN_FILTER_OPTIONS, SUBSCRIPTION_FILTER_OPTIONS } from './copy'
|
import { countryOptions, planFilterOptions, subscriptionFilterOptions } from './copy'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
const selectClass =
|
const selectClass =
|
||||||
'h-10 w-full rounded-xl border border-border bg-surface px-3 text-base text-primary sm:text-sm focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30'
|
'h-10 w-full rounded-xl border border-border bg-surface px-3 text-base text-primary sm:text-sm focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30'
|
||||||
@@ -30,21 +31,22 @@ export function AdminAccountsView() {
|
|||||||
setPage,
|
setPage,
|
||||||
retry,
|
retry,
|
||||||
} = useAdminAccounts()
|
} = useAdminAccounts()
|
||||||
|
const { t } = useTranslation(['admin', 'common', 'billing'])
|
||||||
|
|
||||||
const hasFilters = !!search.trim() || !!country || !!plan || !!subscriptionStatus
|
const hasFilters = !!search.trim() || !!country || !!plan || !!subscriptionStatus
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl font-bold text-primary">Cuentas</h1>
|
<h1 className="text-2xl font-bold text-primary">{t('accounts')}</h1>
|
||||||
<p className="mt-1 text-sm text-foreground/60">
|
<p className="mt-1 text-sm text-foreground/60">
|
||||||
Profesores que usan Gruperly, con su plan y su uso.
|
{t('subtitle')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-5 grid gap-3 sm:grid-cols-2 lg:grid-cols-[minmax(0,2fr)_repeat(3,minmax(0,1fr))]">
|
<div className="mt-5 grid gap-3 sm:grid-cols-2 lg:grid-cols-[minmax(0,2fr)_repeat(3,minmax(0,1fr))]">
|
||||||
<label className="block sm:col-span-2 lg:col-span-1">
|
<label className="block sm:col-span-2 lg:col-span-1">
|
||||||
<span className="mb-1.5 block text-sm font-medium text-primary">Buscar</span>
|
<span className="mb-1.5 block text-sm font-medium text-primary">{t('filters.search')}</span>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<Search
|
<Search
|
||||||
className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-foreground/40"
|
className="pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-foreground/40"
|
||||||
@@ -55,21 +57,21 @@ export function AdminAccountsView() {
|
|||||||
autoFocus
|
autoFocus
|
||||||
value={search}
|
value={search}
|
||||||
onChange={(event) => setSearch(event.target.value)}
|
onChange={(event) => setSearch(event.target.value)}
|
||||||
placeholder="Nombre o email"
|
placeholder={t('filters.searchPlaceholder')}
|
||||||
className="pl-9"
|
className="pl-9"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="block">
|
<label className="block">
|
||||||
<span className="mb-1.5 block text-sm font-medium text-primary">País</span>
|
<span className="mb-1.5 block text-sm font-medium text-primary">{t('filters.country')}</span>
|
||||||
<select
|
<select
|
||||||
value={country ?? ''}
|
value={country ?? ''}
|
||||||
onChange={(event) => setCountry((event.target.value || null) as CountryCode | null)}
|
onChange={(event) => setCountry((event.target.value || null) as CountryCode | null)}
|
||||||
className={selectClass}
|
className={selectClass}
|
||||||
>
|
>
|
||||||
<option value="">Todos</option>
|
<option value="">{t('filters.all')}</option>
|
||||||
{COUNTRY_OPTIONS.map((option) => (
|
{countryOptions().map((option) => (
|
||||||
<option key={option.value} value={option.value}>
|
<option key={option.value} value={option.value}>
|
||||||
{option.label}
|
{option.label}
|
||||||
</option>
|
</option>
|
||||||
@@ -78,14 +80,14 @@ export function AdminAccountsView() {
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="block">
|
<label className="block">
|
||||||
<span className="mb-1.5 block text-sm font-medium text-primary">Plan</span>
|
<span className="mb-1.5 block text-sm font-medium text-primary">{t('filters.plan')}</span>
|
||||||
<select
|
<select
|
||||||
value={plan ?? ''}
|
value={plan ?? ''}
|
||||||
onChange={(event) => setPlan((event.target.value || null) as AdminPlanFilter | null)}
|
onChange={(event) => setPlan((event.target.value || null) as AdminPlanFilter | null)}
|
||||||
className={selectClass}
|
className={selectClass}
|
||||||
>
|
>
|
||||||
<option value="">Todos</option>
|
<option value="">{t('filters.all')}</option>
|
||||||
{PLAN_FILTER_OPTIONS.map((option) => (
|
{planFilterOptions().map((option) => (
|
||||||
<option key={option.value} value={option.value}>
|
<option key={option.value} value={option.value}>
|
||||||
{option.label}
|
{option.label}
|
||||||
</option>
|
</option>
|
||||||
@@ -94,7 +96,7 @@ export function AdminAccountsView() {
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="block">
|
<label className="block">
|
||||||
<span className="mb-1.5 block text-sm font-medium text-primary">Suscripción</span>
|
<span className="mb-1.5 block text-sm font-medium text-primary">{t('filters.subscription')}</span>
|
||||||
<select
|
<select
|
||||||
value={subscriptionStatus ?? ''}
|
value={subscriptionStatus ?? ''}
|
||||||
onChange={(event) =>
|
onChange={(event) =>
|
||||||
@@ -102,8 +104,8 @@ export function AdminAccountsView() {
|
|||||||
}
|
}
|
||||||
className={selectClass}
|
className={selectClass}
|
||||||
>
|
>
|
||||||
<option value="">Todas</option>
|
<option value="">{t('filters.allFem')}</option>
|
||||||
{SUBSCRIPTION_FILTER_OPTIONS.map((option) => (
|
{subscriptionFilterOptions().map((option) => (
|
||||||
<option key={option.value} value={option.value}>
|
<option key={option.value} value={option.value}>
|
||||||
{option.label}
|
{option.label}
|
||||||
</option>
|
</option>
|
||||||
@@ -115,7 +117,7 @@ export function AdminAccountsView() {
|
|||||||
{isPending ? (
|
{isPending ? (
|
||||||
<div className="mt-8 flex items-center justify-center py-16" role="status">
|
<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" />
|
<Loader2 className="size-6 animate-spin text-secondary/50" aria-hidden="true" />
|
||||||
<span className="sr-only">Cargando cuentas</span>
|
<span className="sr-only">{t('loading')}</span>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
@@ -123,7 +125,7 @@ export function AdminAccountsView() {
|
|||||||
<div className="mt-8 space-y-3 rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger">
|
<div className="mt-8 space-y-3 rounded-xl bg-danger-soft px-4 py-3 text-sm text-danger">
|
||||||
<p>{errorMessage}</p>
|
<p>{errorMessage}</p>
|
||||||
<Button variant="outline" size="sm" onClick={retry}>
|
<Button variant="outline" size="sm" onClick={retry}>
|
||||||
Reintentar
|
{t('common:actions.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
@@ -134,11 +136,11 @@ export function AdminAccountsView() {
|
|||||||
<Users className="size-7" aria-hidden="true" />
|
<Users className="size-7" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
<p className="mt-4 text-base font-semibold text-primary">
|
<p className="mt-4 text-base font-semibold text-primary">
|
||||||
{hasFilters ? 'Ninguna cuenta coincide' : 'Todavía no hay cuentas'}
|
{hasFilters ? t('noMatch') : t('empty')}
|
||||||
</p>
|
</p>
|
||||||
{hasFilters ? (
|
{hasFilters ? (
|
||||||
<p className="mx-auto mt-1.5 max-w-[34ch] text-sm leading-relaxed text-secondary">
|
<p className="mx-auto mt-1.5 max-w-[34ch] text-sm leading-relaxed text-secondary">
|
||||||
Probá con otra búsqueda o sacá algún filtro.
|
{t('noMatchHint')}
|
||||||
</p>
|
</p>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
@@ -158,12 +160,12 @@ export function AdminAccountsView() {
|
|||||||
ACCOUNT_GRID_COLUMNS,
|
ACCOUNT_GRID_COLUMNS,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<span>Cuenta</span>
|
<span>{t('columns.account')}</span>
|
||||||
<span>País</span>
|
<span>{t('columns.country')}</span>
|
||||||
<span>Plan</span>
|
<span>{t('columns.plan')}</span>
|
||||||
<span>Suscripción</span>
|
<span>{t('columns.subscription')}</span>
|
||||||
<span className="text-right">Grupos</span>
|
<span className="text-right">{t('columns.groups')}</span>
|
||||||
<span className="text-right">Alumnos</span>
|
<span className="text-right">{t('columns.students')}</span>
|
||||||
<span />
|
<span />
|
||||||
</div>
|
</div>
|
||||||
<ul className="space-y-3 lg:space-y-0">
|
<ul className="space-y-3 lg:space-y-0">
|
||||||
@@ -176,10 +178,10 @@ export function AdminAccountsView() {
|
|||||||
<div className="mt-6 flex items-center justify-between gap-3">
|
<div className="mt-6 flex items-center justify-between gap-3">
|
||||||
<Button variant="outline" size="sm" disabled={page <= 1} onClick={() => setPage(page - 1)}>
|
<Button variant="outline" size="sm" disabled={page <= 1} onClick={() => setPage(page - 1)}>
|
||||||
<ChevronLeft className="size-4" />
|
<ChevronLeft className="size-4" />
|
||||||
Anteriores
|
{t('prev')}
|
||||||
</Button>
|
</Button>
|
||||||
<p className="text-xs text-foreground/50">
|
<p className="text-xs text-foreground/50">
|
||||||
Página {page} de {totalPages} · {total} {total === 1 ? 'cuenta' : 'cuentas'}
|
{t('pageInfo', { page, pages: totalPages, count: total })}
|
||||||
</p>
|
</p>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -187,7 +189,7 @@ export function AdminAccountsView() {
|
|||||||
disabled={page >= totalPages}
|
disabled={page >= totalPages}
|
||||||
onClick={() => setPage(page + 1)}
|
onClick={() => setPage(page + 1)}
|
||||||
>
|
>
|
||||||
Siguientes
|
{t('next')}
|
||||||
<ChevronRight className="size-4" />
|
<ChevronRight className="size-4" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { Button } from '../../components/ui'
|
|||||||
import { useAuth } from '../../context/AuthProvider'
|
import { useAuth } from '../../context/AuthProvider'
|
||||||
import { AdminLayout } from './AdminLayout'
|
import { AdminLayout } from './AdminLayout'
|
||||||
import { useAdminAccess } from './useAdminAccess'
|
import { useAdminAccess } from './useAdminAccess'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
/* El backoffice cuelga de la raíz y no de `_authenticated`: un admin no tiene
|
/* El backoffice cuelga de la raíz y no de `_authenticated`: un admin no tiene
|
||||||
por qué completar el onboarding de profesor. La sesión y el permiso se
|
por qué completar el onboarding de profesor. La sesión y el permiso se
|
||||||
@@ -13,6 +14,7 @@ import { useAdminAccess } from './useAdminAccess'
|
|||||||
export function AdminGuard({ children }: { children: ReactNode }) {
|
export function AdminGuard({ children }: { children: ReactNode }) {
|
||||||
const { user, isPending } = useAuth()
|
const { user, isPending } = useAuth()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
const { t } = useTranslation(['admin', 'common', 'billing'])
|
||||||
const access = useAdminAccess(!!user)
|
const access = useAdminAccess(!!user)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -30,9 +32,9 @@ export function AdminGuard({ children }: { children: ReactNode }) {
|
|||||||
if (access.isError) {
|
if (access.isError) {
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-dvh flex-col items-center justify-center gap-3 px-4 text-center">
|
<div className="flex min-h-dvh flex-col items-center justify-center gap-3 px-4 text-center">
|
||||||
<p className="text-sm text-danger">No pudimos verificar tu acceso al backoffice.</p>
|
<p className="text-sm text-danger">{t('guard.error')}</p>
|
||||||
<Button variant="outline" size="sm" onClick={() => void access.refetch()}>
|
<Button variant="outline" size="sm" onClick={() => void access.refetch()}>
|
||||||
Reintentar
|
{t('common:actions.retry')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@@ -45,13 +47,13 @@ export function AdminGuard({ children }: { children: ReactNode }) {
|
|||||||
<ShieldOff className="size-7" aria-hidden="true" />
|
<ShieldOff className="size-7" aria-hidden="true" />
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-lg font-semibold text-primary">No tenés acceso</h1>
|
<h1 className="text-lg font-semibold text-primary">{t('guard.noAccess')}</h1>
|
||||||
<p className="mt-1 max-w-[36ch] text-sm text-secondary">
|
<p className="mt-1 max-w-[36ch] text-sm text-secondary">
|
||||||
El backoffice es solo para el equipo de Gruperly.
|
{t('guard.noAccessHint')}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<Link to="/" className="text-sm font-medium text-accent-fg hover:underline">
|
<Link to="/" className="text-sm font-medium text-accent-fg hover:underline">
|
||||||
Ir a la app
|
{t('guard.goToApp')}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,16 +2,18 @@ import type { ReactNode } from 'react'
|
|||||||
import { Link } from '@tanstack/react-router'
|
import { Link } from '@tanstack/react-router'
|
||||||
import { ArrowLeft } from 'lucide-react'
|
import { ArrowLeft } from 'lucide-react'
|
||||||
import { ThemeToggle } from '../../components/layout/ThemeToggle'
|
import { ThemeToggle } from '../../components/layout/ThemeToggle'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
||||||
/* Layout propio del backoffice: sin la navegación del profesor y pensado para
|
/* Layout propio del backoffice: sin la navegación del profesor y pensado para
|
||||||
escritorio, aunque en móvil se lee igual (columna única). */
|
escritorio, aunque en móvil se lee igual (columna única). */
|
||||||
export function AdminLayout({ children }: { children: ReactNode }) {
|
export function AdminLayout({ children }: { children: ReactNode }) {
|
||||||
|
const { t } = useTranslation(['admin', 'common', 'billing'])
|
||||||
return (
|
return (
|
||||||
<div className="min-h-dvh bg-background">
|
<div className="min-h-dvh bg-background">
|
||||||
<header className="sticky top-0 z-30 border-b border-border bg-surface/90 backdrop-blur">
|
<header className="sticky top-0 z-30 border-b border-border bg-surface/90 backdrop-blur">
|
||||||
<div className="mx-auto flex h-14 max-w-6xl items-center justify-between gap-3 px-4 lg:px-8">
|
<div className="mx-auto flex h-14 max-w-6xl items-center justify-between gap-3 px-4 lg:px-8">
|
||||||
<Link to="/admin" className="text-base font-bold text-primary">
|
<Link to="/admin" className="text-base font-bold text-primary">
|
||||||
Gruperly <span className="font-medium text-foreground/50">· Backoffice</span>
|
Gruperly <span className="font-medium text-foreground/50">· {t('brand')}</span>
|
||||||
</Link>
|
</Link>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
@@ -20,7 +22,7 @@ export function AdminLayout({ children }: { children: ReactNode }) {
|
|||||||
className="hidden items-center gap-1.5 rounded-xl px-3 py-1.5 text-sm font-medium text-foreground/70 transition-colors hover:bg-primary-soft hover:text-primary lg:inline-flex"
|
className="hidden items-center gap-1.5 rounded-xl px-3 py-1.5 text-sm font-medium text-foreground/70 transition-colors hover:bg-primary-soft hover:text-primary lg:inline-flex"
|
||||||
>
|
>
|
||||||
<ArrowLeft className="size-4" aria-hidden="true" />
|
<ArrowLeft className="size-4" aria-hidden="true" />
|
||||||
Volver a la app
|
{t('backToApp')}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,38 +6,43 @@ import type {
|
|||||||
Plan,
|
Plan,
|
||||||
SubscriptionStatus,
|
SubscriptionStatus,
|
||||||
} from '@gruperly/shared'
|
} from '@gruperly/shared'
|
||||||
import { COUNTRY_LABELS } from '@gruperly/shared'
|
import { COUNTRY_CURRENCY } from '@gruperly/shared'
|
||||||
|
import { countryName } from '../../i18n/countries'
|
||||||
|
import { i18n } from '../../i18n/instance'
|
||||||
import type { BadgeVariant } from '../../components/ui'
|
import type { BadgeVariant } from '../../components/ui'
|
||||||
import { PLAN_NAMES, subscriptionStatusLabel } from '../billing'
|
import { PLAN_NAMES, subscriptionStatusLabel } from '../billing'
|
||||||
|
|
||||||
/* Copy del backoffice. Los nombres de plan y de estado de suscripción salen de
|
/* Copy del backoffice. Los nombres de plan y de estado de suscripción salen de
|
||||||
billing, así el equipo ve lo mismo que el profesor en su pantalla del plan. */
|
billing, así el equipo ve lo mismo que el profesor en su pantalla del plan. */
|
||||||
|
|
||||||
export const PLAN_FILTER_OPTIONS: readonly { value: AdminPlanFilter; label: string }[] = [
|
export function planFilterOptions(): { value: AdminPlanFilter; label: string }[] {
|
||||||
|
return [
|
||||||
{ value: 'PRO', label: PLAN_NAMES.PRO },
|
{ value: 'PRO', label: PLAN_NAMES.PRO },
|
||||||
{ value: 'FREE', label: PLAN_NAMES.FREE },
|
{ value: 'FREE', label: PLAN_NAMES.FREE },
|
||||||
{ value: 'NOT_SELECTED', label: 'Sin elegir' },
|
{ value: 'NOT_SELECTED', label: i18n.t('admin:filters.notSelected') },
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export const SUBSCRIPTION_FILTER_OPTIONS: readonly { value: AdminSubscriptionFilter; label: string }[] = [
|
export function subscriptionFilterOptions(): { value: AdminSubscriptionFilter; label: string }[] {
|
||||||
|
return [
|
||||||
{ value: 'AUTHORIZED', label: subscriptionStatusLabel('AUTHORIZED') },
|
{ value: 'AUTHORIZED', label: subscriptionStatusLabel('AUTHORIZED') },
|
||||||
{ value: 'PENDING', label: subscriptionStatusLabel('PENDING') },
|
{ value: 'PENDING', label: subscriptionStatusLabel('PENDING') },
|
||||||
{ value: 'PAUSED', label: subscriptionStatusLabel('PAUSED') },
|
{ value: 'PAUSED', label: subscriptionStatusLabel('PAUSED') },
|
||||||
{ value: 'CANCELLED', label: subscriptionStatusLabel('CANCELLED') },
|
{ value: 'CANCELLED', label: subscriptionStatusLabel('CANCELLED') },
|
||||||
{ value: 'NONE', label: subscriptionStatusLabel(null) },
|
{ value: 'NONE', label: subscriptionStatusLabel(null) },
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export const COUNTRY_OPTIONS = (Object.keys(COUNTRY_LABELS) as CountryCode[]).map((code) => ({
|
export function countryOptions(): { value: CountryCode; label: string }[] {
|
||||||
value: code,
|
return (Object.keys(COUNTRY_CURRENCY) as CountryCode[]).map((code) => ({ value: code, label: countryName(code) }))
|
||||||
label: COUNTRY_LABELS[code],
|
}
|
||||||
}))
|
|
||||||
|
|
||||||
export function countryLabel(country: CountryCode | null): string {
|
export function countryLabel(country: CountryCode | null): string {
|
||||||
return country ? COUNTRY_LABELS[country] : 'Sin país'
|
return country ? countryName(country) : i18n.t('admin:noCountry')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function planLabel(plan: Plan | null): string {
|
export function planLabel(plan: Plan | null): string {
|
||||||
return plan ? PLAN_NAMES[plan] : 'Sin elegir'
|
return plan ? PLAN_NAMES[plan] : i18n.t('admin:filters.notSelected')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function planVariant(plan: Plan | null): BadgeVariant {
|
export function planVariant(plan: Plan | null): BadgeVariant {
|
||||||
@@ -60,16 +65,10 @@ export function subscriptionVariant(status: SubscriptionStatus | null): BadgeVar
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MP_STATUS_LABELS: Record<NonNullable<AdminAccountDetail['mpStatus']> | 'NONE', string> = {
|
export function mpStatusLabel(status: AdminAccountDetail['mpStatus']): string {
|
||||||
ACTIVE: 'Vinculada',
|
return i18n.t(`admin:mpStatus.${status ?? 'NONE'}`)
|
||||||
REQUIRES_REAUTH: 'Requiere volver a vincular',
|
|
||||||
REVOKED: 'Desvinculada',
|
|
||||||
NONE: 'Sin vincular',
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WHATSAPP_STATUS_LABELS: Record<NonNullable<AdminAccountDetail['whatsappStatus']> | 'NONE', string> = {
|
export function whatsappStatusLabel(status: AdminAccountDetail['whatsappStatus']): string {
|
||||||
ACTIVE: 'Conectado',
|
return i18n.t(`admin:whatsappStatus.${status ?? 'NONE'}`)
|
||||||
PENDING: 'Conectando',
|
|
||||||
DISCONNECTED: 'Desconectado',
|
|
||||||
NONE: 'Sin conectar',
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
apps/web/src/i18n/i18next.d.ts
vendored
2
apps/web/src/i18n/i18next.d.ts
vendored
@@ -22,6 +22,7 @@ import type account from './locales/es-AR/account.json'
|
|||||||
import type public from './locales/es-AR/public.json'
|
import type public from './locales/es-AR/public.json'
|
||||||
import type studentAccess from './locales/es-AR/studentAccess.json'
|
import type studentAccess from './locales/es-AR/studentAccess.json'
|
||||||
import type student from './locales/es-AR/student.json'
|
import type student from './locales/es-AR/student.json'
|
||||||
|
import type admin from './locales/es-AR/admin.json'
|
||||||
import type validation from './locales/es-AR/validation.json'
|
import type validation from './locales/es-AR/validation.json'
|
||||||
|
|
||||||
// es-AR es la fuente: una clave que no exista ahí rompe el typecheck.
|
// es-AR es la fuente: una clave que no exista ahí rompe el typecheck.
|
||||||
@@ -36,6 +37,7 @@ declare module 'i18next' {
|
|||||||
pwa: typeof pwa
|
pwa: typeof pwa
|
||||||
settings: typeof settings
|
settings: typeof settings
|
||||||
validation: typeof validation
|
validation: typeof validation
|
||||||
|
'admin': typeof admin
|
||||||
'student': typeof student
|
'student': typeof student
|
||||||
'studentAccess': typeof studentAccess
|
'studentAccess': typeof studentAccess
|
||||||
'public': typeof public
|
'public': typeof public
|
||||||
|
|||||||
90
apps/web/src/i18n/locales/en/admin.json
Normal file
90
apps/web/src/i18n/locales/en/admin.json
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"brand": "Back office",
|
||||||
|
"backToApp": "Back to the app",
|
||||||
|
"accounts": "Accounts",
|
||||||
|
"subtitle": "Teachers using Gruperly, with their plan and usage.",
|
||||||
|
"guard": {
|
||||||
|
"error": "We couldn't verify your back office access.",
|
||||||
|
"noAccess": "You don't have access",
|
||||||
|
"noAccessHint": "The back office is only for the Gruperly team.",
|
||||||
|
"goToApp": "Go to the app"
|
||||||
|
},
|
||||||
|
"filters": {
|
||||||
|
"search": "Search",
|
||||||
|
"searchPlaceholder": "Name or email",
|
||||||
|
"country": "Country",
|
||||||
|
"plan": "Plan",
|
||||||
|
"subscription": "Subscription",
|
||||||
|
"all": "All",
|
||||||
|
"allFem": "All",
|
||||||
|
"notSelected": "Not chosen"
|
||||||
|
},
|
||||||
|
"loading": "Loading accounts",
|
||||||
|
"loadError": "We couldn't load the accounts.",
|
||||||
|
"noMatch": "No accounts match",
|
||||||
|
"noMatchHint": "Try another search or remove a filter.",
|
||||||
|
"empty": "No accounts yet",
|
||||||
|
"columns": {
|
||||||
|
"account": "Account",
|
||||||
|
"country": "Country",
|
||||||
|
"plan": "Plan",
|
||||||
|
"subscription": "Subscription",
|
||||||
|
"groups": "Groups",
|
||||||
|
"students": "Students"
|
||||||
|
},
|
||||||
|
"prev": "Previous",
|
||||||
|
"next": "Next",
|
||||||
|
"pageInfo_one": "Page {{page}} of {{pages}} · {{count}} account",
|
||||||
|
"pageInfo_other": "Page {{page}} of {{pages}} · {{count}} accounts",
|
||||||
|
"row": {
|
||||||
|
"groups_one": "{{count}} group",
|
||||||
|
"groups_other": "{{count}} groups",
|
||||||
|
"students_one": "{{count}} student",
|
||||||
|
"students_other": "{{count}} students",
|
||||||
|
"until": " · through {{date}}"
|
||||||
|
},
|
||||||
|
"noCountry": "No country",
|
||||||
|
"detail": {
|
||||||
|
"fallback": "Account",
|
||||||
|
"loading": "Loading account",
|
||||||
|
"loadError": "We couldn't load the account.",
|
||||||
|
"notFound": "This account doesn't exist.",
|
||||||
|
"account": "Account",
|
||||||
|
"country": "Country",
|
||||||
|
"createdAt": "Signed up",
|
||||||
|
"onboarding": "Onboarding",
|
||||||
|
"onboardingDone": "Complete",
|
||||||
|
"onboardingPending": "Incomplete",
|
||||||
|
"plan": "Plan",
|
||||||
|
"readOnly": "Read-only",
|
||||||
|
"chosenOn": "Chosen on",
|
||||||
|
"subscription": "Subscription",
|
||||||
|
"provider": "Billed by",
|
||||||
|
"price": "Price",
|
||||||
|
"perMonth": "{{price}} / month",
|
||||||
|
"paidThrough": "Paid through",
|
||||||
|
"nextPayment": "Next charge",
|
||||||
|
"payerEmail": "Payer email",
|
||||||
|
"graceUntil": "Grace period until",
|
||||||
|
"usage": "Usage",
|
||||||
|
"groups": "Groups",
|
||||||
|
"students": "Active students",
|
||||||
|
"groupLine_one": "{{count}} student · since {{date}}",
|
||||||
|
"groupLine_other": "{{count}} students · since {{date}}",
|
||||||
|
"noGroups": "No groups created yet.",
|
||||||
|
"charges": "Gruperly charges",
|
||||||
|
"noCharges": "No charges on record."
|
||||||
|
},
|
||||||
|
"mpStatus": {
|
||||||
|
"ACTIVE": "Linked",
|
||||||
|
"REQUIRES_REAUTH": "Needs relinking",
|
||||||
|
"REVOKED": "Unlinked",
|
||||||
|
"NONE": "Not linked"
|
||||||
|
},
|
||||||
|
"whatsappStatus": {
|
||||||
|
"ACTIVE": "Connected",
|
||||||
|
"PENDING": "Connecting",
|
||||||
|
"DISCONNECTED": "Disconnected",
|
||||||
|
"NONE": "Not connected"
|
||||||
|
}
|
||||||
|
}
|
||||||
90
apps/web/src/i18n/locales/es-419/admin.json
Normal file
90
apps/web/src/i18n/locales/es-419/admin.json
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"brand": "Backoffice",
|
||||||
|
"backToApp": "Volver a la app",
|
||||||
|
"accounts": "Cuentas",
|
||||||
|
"subtitle": "Profesores que usan Gruperly, con su plan y su uso.",
|
||||||
|
"guard": {
|
||||||
|
"error": "No pudimos verificar tu acceso al backoffice.",
|
||||||
|
"noAccess": "No tienes acceso",
|
||||||
|
"noAccessHint": "El backoffice es solo para el equipo de Gruperly.",
|
||||||
|
"goToApp": "Ir a la app"
|
||||||
|
},
|
||||||
|
"filters": {
|
||||||
|
"search": "Buscar",
|
||||||
|
"searchPlaceholder": "Nombre o email",
|
||||||
|
"country": "País",
|
||||||
|
"plan": "Plan",
|
||||||
|
"subscription": "Suscripción",
|
||||||
|
"all": "Todos",
|
||||||
|
"allFem": "Todas",
|
||||||
|
"notSelected": "Sin elegir"
|
||||||
|
},
|
||||||
|
"loading": "Cargando cuentas",
|
||||||
|
"loadError": "No pudimos cargar las cuentas.",
|
||||||
|
"noMatch": "Ninguna cuenta coincide",
|
||||||
|
"noMatchHint": "Prueba con otra búsqueda o quita algún filtro.",
|
||||||
|
"empty": "Todavía no hay cuentas",
|
||||||
|
"columns": {
|
||||||
|
"account": "Cuenta",
|
||||||
|
"country": "País",
|
||||||
|
"plan": "Plan",
|
||||||
|
"subscription": "Suscripción",
|
||||||
|
"groups": "Grupos",
|
||||||
|
"students": "Alumnos"
|
||||||
|
},
|
||||||
|
"prev": "Anteriores",
|
||||||
|
"next": "Siguientes",
|
||||||
|
"pageInfo_one": "Página {{page}} de {{pages}} · {{count}} cuenta",
|
||||||
|
"pageInfo_other": "Página {{page}} de {{pages}} · {{count}} cuentas",
|
||||||
|
"row": {
|
||||||
|
"groups_one": "{{count}} grupo",
|
||||||
|
"groups_other": "{{count}} grupos",
|
||||||
|
"students_one": "{{count}} alumno",
|
||||||
|
"students_other": "{{count}} alumnos",
|
||||||
|
"until": " · hasta {{date}}"
|
||||||
|
},
|
||||||
|
"noCountry": "Sin país",
|
||||||
|
"detail": {
|
||||||
|
"fallback": "Cuenta",
|
||||||
|
"loading": "Cargando cuenta",
|
||||||
|
"loadError": "No pudimos cargar la cuenta.",
|
||||||
|
"notFound": "Esta cuenta no existe.",
|
||||||
|
"account": "Cuenta",
|
||||||
|
"country": "País",
|
||||||
|
"createdAt": "Alta",
|
||||||
|
"onboarding": "Onboarding",
|
||||||
|
"onboardingDone": "Completo",
|
||||||
|
"onboardingPending": "Sin terminar",
|
||||||
|
"plan": "Plan",
|
||||||
|
"readOnly": "Solo lectura",
|
||||||
|
"chosenOn": "Elegido el",
|
||||||
|
"subscription": "Suscripción",
|
||||||
|
"provider": "Cobra",
|
||||||
|
"price": "Precio",
|
||||||
|
"perMonth": "{{price}} / mes",
|
||||||
|
"paidThrough": "Pagado hasta",
|
||||||
|
"nextPayment": "Próximo cobro",
|
||||||
|
"payerEmail": "Email de pago",
|
||||||
|
"graceUntil": "En gracia hasta",
|
||||||
|
"usage": "Uso",
|
||||||
|
"groups": "Grupos",
|
||||||
|
"students": "Alumnos activos",
|
||||||
|
"groupLine_one": "{{count}} alumno · desde {{date}}",
|
||||||
|
"groupLine_other": "{{count}} alumnos · desde {{date}}",
|
||||||
|
"noGroups": "Todavía no creó grupos.",
|
||||||
|
"charges": "Cobros de Gruperly",
|
||||||
|
"noCharges": "Sin cobros registrados."
|
||||||
|
},
|
||||||
|
"mpStatus": {
|
||||||
|
"ACTIVE": "Vinculada",
|
||||||
|
"REQUIRES_REAUTH": "Requiere volver a vincular",
|
||||||
|
"REVOKED": "Desvinculada",
|
||||||
|
"NONE": "Sin vincular"
|
||||||
|
},
|
||||||
|
"whatsappStatus": {
|
||||||
|
"ACTIVE": "Conectado",
|
||||||
|
"PENDING": "Conectando",
|
||||||
|
"DISCONNECTED": "Desconectado",
|
||||||
|
"NONE": "Sin conectar"
|
||||||
|
}
|
||||||
|
}
|
||||||
90
apps/web/src/i18n/locales/es-AR/admin.json
Normal file
90
apps/web/src/i18n/locales/es-AR/admin.json
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"brand": "Backoffice",
|
||||||
|
"backToApp": "Volver a la app",
|
||||||
|
"accounts": "Cuentas",
|
||||||
|
"subtitle": "Profesores que usan Gruperly, con su plan y su uso.",
|
||||||
|
"guard": {
|
||||||
|
"error": "No pudimos verificar tu acceso al backoffice.",
|
||||||
|
"noAccess": "No tenés acceso",
|
||||||
|
"noAccessHint": "El backoffice es solo para el equipo de Gruperly.",
|
||||||
|
"goToApp": "Ir a la app"
|
||||||
|
},
|
||||||
|
"filters": {
|
||||||
|
"search": "Buscar",
|
||||||
|
"searchPlaceholder": "Nombre o email",
|
||||||
|
"country": "País",
|
||||||
|
"plan": "Plan",
|
||||||
|
"subscription": "Suscripción",
|
||||||
|
"all": "Todos",
|
||||||
|
"allFem": "Todas",
|
||||||
|
"notSelected": "Sin elegir"
|
||||||
|
},
|
||||||
|
"loading": "Cargando cuentas",
|
||||||
|
"loadError": "No pudimos cargar las cuentas.",
|
||||||
|
"noMatch": "Ninguna cuenta coincide",
|
||||||
|
"noMatchHint": "Probá con otra búsqueda o sacá algún filtro.",
|
||||||
|
"empty": "Todavía no hay cuentas",
|
||||||
|
"columns": {
|
||||||
|
"account": "Cuenta",
|
||||||
|
"country": "País",
|
||||||
|
"plan": "Plan",
|
||||||
|
"subscription": "Suscripción",
|
||||||
|
"groups": "Grupos",
|
||||||
|
"students": "Alumnos"
|
||||||
|
},
|
||||||
|
"prev": "Anteriores",
|
||||||
|
"next": "Siguientes",
|
||||||
|
"pageInfo_one": "Página {{page}} de {{pages}} · {{count}} cuenta",
|
||||||
|
"pageInfo_other": "Página {{page}} de {{pages}} · {{count}} cuentas",
|
||||||
|
"row": {
|
||||||
|
"groups_one": "{{count}} grupo",
|
||||||
|
"groups_other": "{{count}} grupos",
|
||||||
|
"students_one": "{{count}} alumno",
|
||||||
|
"students_other": "{{count}} alumnos",
|
||||||
|
"until": " · hasta {{date}}"
|
||||||
|
},
|
||||||
|
"noCountry": "Sin país",
|
||||||
|
"detail": {
|
||||||
|
"fallback": "Cuenta",
|
||||||
|
"loading": "Cargando cuenta",
|
||||||
|
"loadError": "No pudimos cargar la cuenta.",
|
||||||
|
"notFound": "Esta cuenta no existe.",
|
||||||
|
"account": "Cuenta",
|
||||||
|
"country": "País",
|
||||||
|
"createdAt": "Alta",
|
||||||
|
"onboarding": "Onboarding",
|
||||||
|
"onboardingDone": "Completo",
|
||||||
|
"onboardingPending": "Sin terminar",
|
||||||
|
"plan": "Plan",
|
||||||
|
"readOnly": "Solo lectura",
|
||||||
|
"chosenOn": "Elegido el",
|
||||||
|
"subscription": "Suscripción",
|
||||||
|
"provider": "Cobra",
|
||||||
|
"price": "Precio",
|
||||||
|
"perMonth": "{{price}} / mes",
|
||||||
|
"paidThrough": "Pagado hasta",
|
||||||
|
"nextPayment": "Próximo cobro",
|
||||||
|
"payerEmail": "Email de pago",
|
||||||
|
"graceUntil": "En gracia hasta",
|
||||||
|
"usage": "Uso",
|
||||||
|
"groups": "Grupos",
|
||||||
|
"students": "Alumnos activos",
|
||||||
|
"groupLine_one": "{{count}} alumno · desde {{date}}",
|
||||||
|
"groupLine_other": "{{count}} alumnos · desde {{date}}",
|
||||||
|
"noGroups": "Todavía no creó grupos.",
|
||||||
|
"charges": "Cobros de Gruperly",
|
||||||
|
"noCharges": "Sin cobros registrados."
|
||||||
|
},
|
||||||
|
"mpStatus": {
|
||||||
|
"ACTIVE": "Vinculada",
|
||||||
|
"REQUIRES_REAUTH": "Requiere volver a vincular",
|
||||||
|
"REVOKED": "Desvinculada",
|
||||||
|
"NONE": "Sin vincular"
|
||||||
|
},
|
||||||
|
"whatsappStatus": {
|
||||||
|
"ACTIVE": "Conectado",
|
||||||
|
"PENDING": "Conectando",
|
||||||
|
"DISCONNECTED": "Desconectado",
|
||||||
|
"NONE": "Sin conectar"
|
||||||
|
}
|
||||||
|
}
|
||||||
90
apps/web/src/i18n/locales/pt-BR/admin.json
Normal file
90
apps/web/src/i18n/locales/pt-BR/admin.json
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"brand": "Backoffice",
|
||||||
|
"backToApp": "Voltar ao app",
|
||||||
|
"accounts": "Contas",
|
||||||
|
"subtitle": "Professores que usam o Gruperly, com plano e uso.",
|
||||||
|
"guard": {
|
||||||
|
"error": "Não conseguimos verificar seu acesso ao backoffice.",
|
||||||
|
"noAccess": "Você não tem acesso",
|
||||||
|
"noAccessHint": "O backoffice é só para a equipe do Gruperly.",
|
||||||
|
"goToApp": "Ir para o app"
|
||||||
|
},
|
||||||
|
"filters": {
|
||||||
|
"search": "Buscar",
|
||||||
|
"searchPlaceholder": "Nome ou e-mail",
|
||||||
|
"country": "País",
|
||||||
|
"plan": "Plano",
|
||||||
|
"subscription": "Assinatura",
|
||||||
|
"all": "Todos",
|
||||||
|
"allFem": "Todas",
|
||||||
|
"notSelected": "Não escolhido"
|
||||||
|
},
|
||||||
|
"loading": "Carregando contas",
|
||||||
|
"loadError": "Não conseguimos carregar as contas.",
|
||||||
|
"noMatch": "Nenhuma conta corresponde",
|
||||||
|
"noMatchHint": "Tente outra busca ou remova algum filtro.",
|
||||||
|
"empty": "Ainda não há contas",
|
||||||
|
"columns": {
|
||||||
|
"account": "Conta",
|
||||||
|
"country": "País",
|
||||||
|
"plan": "Plano",
|
||||||
|
"subscription": "Assinatura",
|
||||||
|
"groups": "Grupos",
|
||||||
|
"students": "Alunos"
|
||||||
|
},
|
||||||
|
"prev": "Anteriores",
|
||||||
|
"next": "Próximas",
|
||||||
|
"pageInfo_one": "Página {{page}} de {{pages}} · {{count}} conta",
|
||||||
|
"pageInfo_other": "Página {{page}} de {{pages}} · {{count}} contas",
|
||||||
|
"row": {
|
||||||
|
"groups_one": "{{count}} grupo",
|
||||||
|
"groups_other": "{{count}} grupos",
|
||||||
|
"students_one": "{{count}} aluno",
|
||||||
|
"students_other": "{{count}} alunos",
|
||||||
|
"until": " · até {{date}}"
|
||||||
|
},
|
||||||
|
"noCountry": "Sem país",
|
||||||
|
"detail": {
|
||||||
|
"fallback": "Conta",
|
||||||
|
"loading": "Carregando conta",
|
||||||
|
"loadError": "Não conseguimos carregar a conta.",
|
||||||
|
"notFound": "Esta conta não existe.",
|
||||||
|
"account": "Conta",
|
||||||
|
"country": "País",
|
||||||
|
"createdAt": "Cadastro",
|
||||||
|
"onboarding": "Onboarding",
|
||||||
|
"onboardingDone": "Completo",
|
||||||
|
"onboardingPending": "Incompleto",
|
||||||
|
"plan": "Plano",
|
||||||
|
"readOnly": "Somente leitura",
|
||||||
|
"chosenOn": "Escolhido em",
|
||||||
|
"subscription": "Assinatura",
|
||||||
|
"provider": "Cobra",
|
||||||
|
"price": "Preço",
|
||||||
|
"perMonth": "{{price}} / mês",
|
||||||
|
"paidThrough": "Pago até",
|
||||||
|
"nextPayment": "Próxima cobrança",
|
||||||
|
"payerEmail": "E-mail de pagamento",
|
||||||
|
"graceUntil": "Em carência até",
|
||||||
|
"usage": "Uso",
|
||||||
|
"groups": "Grupos",
|
||||||
|
"students": "Alunos ativos",
|
||||||
|
"groupLine_one": "{{count}} aluno · desde {{date}}",
|
||||||
|
"groupLine_other": "{{count}} alunos · desde {{date}}",
|
||||||
|
"noGroups": "Ainda não criou grupos.",
|
||||||
|
"charges": "Cobranças do Gruperly",
|
||||||
|
"noCharges": "Nenhuma cobrança registrada."
|
||||||
|
},
|
||||||
|
"mpStatus": {
|
||||||
|
"ACTIVE": "Vinculada",
|
||||||
|
"REQUIRES_REAUTH": "Precisa vincular de novo",
|
||||||
|
"REVOKED": "Desvinculada",
|
||||||
|
"NONE": "Não vinculada"
|
||||||
|
},
|
||||||
|
"whatsappStatus": {
|
||||||
|
"ACTIVE": "Conectado",
|
||||||
|
"PENDING": "Conectando",
|
||||||
|
"DISCONNECTED": "Desconectado",
|
||||||
|
"NONE": "Não conectado"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user