bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/connection-status/button/container.jsx

25 lines
919 B
React
Raw Normal View History

import React from 'react';
import { useReactiveVar } from '@apollo/client';
import ConnectionStatusButtonComponent from './component';
import connectionStatus from '/imports/ui/core/graphql/singletons/connectionStatus';
import { getWorstStatus } from '../service';
const ConnectionStatusButtonContainer = (props) => {
const connected = useReactiveVar(connectionStatus.getConnectedStatusVar());
const rttStatus = useReactiveVar(connectionStatus.getRttStatusVar());
const jitterStatus = useReactiveVar(connectionStatus.getJitterStatusVar());
const packetLossStatus = useReactiveVar(connectionStatus.getPacketLossStatusVar());
const myCurrentStatus = getWorstStatus([rttStatus, jitterStatus, packetLossStatus]);
return (
<ConnectionStatusButtonComponent
myCurrentStatus={myCurrentStatus}
connected={connected}
{...props}
/>
);
};
export default ConnectionStatusButtonContainer;