mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Add translated messages for more connection error states (#19392)
GitOrigin-RevId: 981de624f3964ebe3ff1f0c751fcef9158864d5e
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { FC } from 'react'
|
||||
import { ConnectionError } from '@/features/ide-react/connection/types/connection-state'
|
||||
import getMeta from '@/utils/meta'
|
||||
|
||||
// NOTE: i18n translations might not be loaded in the client at this point,
|
||||
// so these translations have to be loaded from meta tags
|
||||
export const LoadingError: FC<{
|
||||
connectionStateError: ConnectionError | ''
|
||||
i18nError?: Error
|
||||
}> = ({ connectionStateError, i18nError }) => {
|
||||
if (connectionStateError) {
|
||||
switch (connectionStateError) {
|
||||
case 'io-not-loaded':
|
||||
return <>{getMeta('ol-translationIoNotLoaded')}</>
|
||||
|
||||
case 'unable-to-join':
|
||||
return <>{getMeta('ol-translationUnableToJoin')}</>
|
||||
}
|
||||
}
|
||||
|
||||
if (i18nError) {
|
||||
return <>{getMeta('ol-translationLoadErrorMessage')}</>
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user