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