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 { createContext, useContext } from 'react'
|
||||
import { ApiError, getAdminAccount } from '../../lib/api'
|
||||
import { errorMessage as apiErrorMessage } from '../../i18n'
|
||||
import { i18n } from '../../i18n/instance'
|
||||
|
||||
type AdminAccountDetailContextValue = {
|
||||
account: AdminAccountDetail | null
|
||||
@@ -30,9 +32,7 @@ export function AdminAccountDetailProvider({
|
||||
const error = accountQuery.error
|
||||
const isNotFound = error instanceof ApiError && error.status === 404
|
||||
const errorMessage = accountQuery.isError
|
||||
? error instanceof ApiError
|
||||
? (error.problem?.detail ?? 'No pudimos cargar la cuenta.')
|
||||
: 'No pudimos cargar la cuenta.'
|
||||
? apiErrorMessage(error, i18n.t('admin:detail.loadError'))
|
||||
: null
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user