2021-06-30 16:12:12 +00:00
|
|
|
// @flow
|
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
|
2021-12-15 13:18:41 +00:00
|
|
|
import ContextMenuItem from '../../../base/components/context-menu/ContextMenuItem';
|
2021-06-30 16:12:12 +00:00
|
|
|
import { translate } from '../../../base/i18n';
|
|
|
|
import { IconInfo } from '../../../base/icons';
|
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import { renderConnectionStatus } from '../../actions.web';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Redux dispatch function.
|
|
|
|
*/
|
|
|
|
dispatch: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The ID of the participant for which to show connection stats.
|
|
|
|
*/
|
|
|
|
participantId: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function to be used to translate i18n labels.
|
|
|
|
*/
|
|
|
|
t: Function
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const ConnectionStatusButton = ({
|
|
|
|
dispatch,
|
|
|
|
t
|
|
|
|
}: Props) => {
|
2021-12-15 13:18:41 +00:00
|
|
|
const onClick = useCallback(e => {
|
|
|
|
e.stopPropagation();
|
2021-06-30 16:12:12 +00:00
|
|
|
dispatch(renderConnectionStatus(true));
|
|
|
|
}, [ dispatch ]);
|
|
|
|
|
|
|
|
return (
|
2021-12-15 13:18:41 +00:00
|
|
|
<ContextMenuItem
|
|
|
|
accessibilityLabel = { t('videothumbnail.connectionInfo') }
|
2021-06-30 16:12:12 +00:00
|
|
|
icon = { IconInfo }
|
2021-12-15 13:18:41 +00:00
|
|
|
onClick = { onClick }
|
|
|
|
text = { t('videothumbnail.connectionInfo') } />
|
2021-06-30 16:12:12 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default translate(connect()(ConnectionStatusButton));
|