import React from 'react'; import { ConnectionStatus } from 'Player'; import { Loader } from 'UI'; import ovStl from './overlay.module.css'; import { useTranslation } from 'react-i18next'; interface Props { text: string; concetionStatus: ConnectionStatus; } export default function LiveStatusText({ text, concetionStatus }: Props) { const { t } = useTranslation(); const renderView = () => { switch (concetionStatus) { case ConnectionStatus.Closed: return (
{t('Session not found')}
{t('The remote session doesn’t exist anymore.')}
{' '} {t( 'The user may have closed the tab/browser while you were trying to establish a connection.', )}
); case ConnectionStatus.Connecting: return (
{t('Connecting...')}
{t('Establishing a connection with the remote session.')}
); case ConnectionStatus.WaitingMessages: return (
{t('Waiting for the session to become active...')}
{t("If it's taking too much time, it could mean the user is simply inactive.")}
); case ConnectionStatus.Connected: return (
{t('Connected')}
); case ConnectionStatus.Inactive: return (
{t('Waiting for the session to become active...')}
{t("If it's taking too much time, it could mean the user is simply inactive")} .
); case ConnectionStatus.Disconnected: return (
{t('Disconnected')}
{t( 'The connection was lost with the remote session. The user may have simply closed the tab/browser', )} .
); case ConnectionStatus.Error: return (
{t('Error')}
{t('Something wrong just happened. Try refreshing the page.')}
); } }; return
{renderView()}
; }