2021-06-30 16:12:12 +00:00
|
|
|
// @flow
|
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../../base/i18n';
|
2022-11-08 10:24:32 +00:00
|
|
|
import { IconInfoCircle } from '../../../base/icons';
|
2021-06-30 16:12:12 +00:00
|
|
|
import { connect } from '../../../base/redux';
|
2022-10-06 10:09:40 +00:00
|
|
|
import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
|
2021-06-30 16:12:12 +00:00
|
|
|
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') }
|
2022-11-08 10:24:32 +00:00
|
|
|
icon = { IconInfoCircle }
|
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));
|