2021-03-26 05:22:50 +08:00
|
|
|
import React from 'react';
|
|
|
|
import ConnectionStatusButtonComponent from './component';
|
2024-05-18 04:33:52 +08:00
|
|
|
import useSettings from '/imports/ui/services/settings/hooks/useSettings';
|
|
|
|
import { SETTINGS } from '/imports/ui/services/settings/enums';
|
2024-06-06 21:50:03 +08:00
|
|
|
import { useStorageKey } from '/imports/ui/services/storage/hooks';
|
2024-06-11 21:43:43 +08:00
|
|
|
import { useReactiveVar } from '@apollo/client';
|
|
|
|
import connectionStatus from '/imports/ui/core/graphql/singletons/connectionStatus';
|
2024-07-05 04:26:09 +08:00
|
|
|
import { getWorstStatus } from '../service';
|
2021-03-26 05:22:50 +08:00
|
|
|
|
2024-06-29 03:58:38 +08:00
|
|
|
const ConnectionStatusButtonContainer = (props) => {
|
2024-06-11 21:43:43 +08:00
|
|
|
const connected = useReactiveVar(connectionStatus.getConnectedStatusVar());
|
2024-07-05 04:26:09 +08:00
|
|
|
const rttStatus = useReactiveVar(connectionStatus.getRttStatusVar());
|
|
|
|
const jitterStatus = useReactiveVar(connectionStatus.getJitterStatusVar());
|
|
|
|
const packetLossStatus = useReactiveVar(connectionStatus.getPacketLossStatusVar());
|
2024-06-11 21:43:43 +08:00
|
|
|
|
2024-07-05 04:26:09 +08:00
|
|
|
const myCurrentStatus = getWorstStatus([rttStatus, jitterStatus, packetLossStatus]);
|
2023-12-05 22:18:45 +08:00
|
|
|
|
2024-05-18 04:33:52 +08:00
|
|
|
const { paginationEnabled } = useSettings(SETTINGS.APPLICATION);
|
|
|
|
const { viewParticipantsWebcams } = useSettings(SETTINGS.DATA_SAVING);
|
2024-06-06 21:50:03 +08:00
|
|
|
const isGridLayout = useStorageKey('isGridEnabled');
|
2024-05-18 04:33:52 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<ConnectionStatusButtonComponent
|
|
|
|
myCurrentStatus={myCurrentStatus}
|
|
|
|
paginationEnabled={paginationEnabled}
|
|
|
|
viewParticipantsWebcams={viewParticipantsWebcams}
|
2024-06-06 21:50:03 +08:00
|
|
|
isGridLayout={isGridLayout}
|
2024-06-11 21:43:43 +08:00
|
|
|
connected={connected}
|
2024-05-18 04:33:52 +08:00
|
|
|
{...props}
|
|
|
|
/>
|
|
|
|
);
|
2023-12-05 22:18:45 +08:00
|
|
|
};
|
2021-03-26 05:22:50 +08:00
|
|
|
|
2024-06-29 03:58:38 +08:00
|
|
|
export default ConnectionStatusButtonContainer;
|