import React from 'react';
import ovStl from 'Components/Session_/Player/Overlay/overlay.module.css';
import { ConnectionStatus } from 'Player';
import { Loader } from 'UI';
import { useTranslation } from 'react-i18next';
interface Props {
connectionStatus: ConnectionStatus;
}
export default function LiveStatusText({ connectionStatus }: Props) {
const { t } = useTranslation();
const renderView = () => {
switch (connectionStatus) {
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 (
);
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()}
;
}