Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import connectivityTypes from 'ringcentral-widgets/modules/ConnectivityManager/connectivityTypes';
export default {
[connectivityTypes.webphoneUnavailable]: "Web Phone indisponible.",
[connectivityTypes.offline]: "Hors ligne",
[connectivityTypes.voipOnly]: "VoIP seulement",
[connectivityTypes.survival]: "Mode limité"
};
// @key: @#@"[connectivityTypes.webphoneUnavailable]"@#@ @source: @#@"Web Phone Unavailable"@#@
// @key: @#@"[connectivityTypes.offline]"@#@ @source: @#@"Offline"@#@
// @key: @#@"[connectivityTypes.voipOnly]"@#@ @source: @#@"VoIP Only"@#@
// @key: @#@"[connectivityTypes.survival]"@#@ @source: @#@"Limited Mode"@#@
export default function ConnectivityBadge({
onClick,
className,
currentLocale,
mode,
webphoneConnecting,
hasLimitedStatusError,
}) {
if (!mode) return null;
const isWebphoneConnecting =
mode === connectivityTypes.webphoneUnavailable && webphoneConnecting;
const hasRetryButton =
mode === connectivityTypes.webphoneUnavailable || hasLimitedStatusError;
let view = null;
if (isWebphoneConnecting) {
view = (
{i18n.getString('Connecting', currentLocale)}
);
} else {
view = (
ConnectivityAlert.handleMessage = ({ message }) =>
message === connectivityTypes.networkLoss ||
message === connectivityTypes.offline ||
message === connectivityTypes.serverUnavailable ||
message === connectivityTypes.voipOnly ||
message === connectivityTypes.survival ||
message === connectivityTypes.webphoneUnavailable;
export default function ConnectivityBadge({
onClick,
className,
currentLocale,
mode,
webphoneConnecting,
hasLimitedStatusError,
}) {
if (!mode) return null;
const isWebphoneConnecting =
mode === connectivityTypes.webphoneUnavailable && webphoneConnecting;
const hasRetryButton =
mode === connectivityTypes.webphoneUnavailable || hasLimitedStatusError;
let view = null;
if (isWebphoneConnecting) {
view = (
{i18n.getString('Connecting', currentLocale)}
);
} else {
view = (