2023-03-21 17:14:17 +02:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { WithTranslation } from 'react-i18next';
|
2018-05-23 15:44:58 +02:00
|
|
|
|
2023-03-21 17:14:17 +02:00
|
|
|
import { IReduxState } from '../../app/types';
|
2024-02-08 13:33:47 +02:00
|
|
|
import { isTranscribing } from '../../transcribing/functions';
|
2024-02-08 15:05:41 +02:00
|
|
|
import { getSessionStatusToShow, isRecordingRunning } from '../functions';
|
2018-09-11 12:16:01 +02:00
|
|
|
|
2024-01-15 16:39:29 +01:00
|
|
|
|
2023-03-21 17:14:17 +02:00
|
|
|
interface IProps extends WithTranslation {
|
2018-05-23 15:44:58 +02:00
|
|
|
|
2021-09-20 21:12:56 +03:00
|
|
|
/**
|
|
|
|
|
* Whether this is the Jibri recorder participant.
|
|
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
_iAmRecorder: boolean;
|
2021-09-20 21:12:56 +03:00
|
|
|
|
2024-02-08 15:05:41 +02:00
|
|
|
/**
|
|
|
|
|
* Whether the recording is currently running.
|
|
|
|
|
*/
|
|
|
|
|
_isRecordingRunning: boolean;
|
|
|
|
|
|
2024-01-15 16:39:29 +01:00
|
|
|
/**
|
|
|
|
|
* Whether this meeting is being transcribed.
|
|
|
|
|
*/
|
|
|
|
|
_isTranscribing: boolean;
|
|
|
|
|
|
2018-05-23 15:44:58 +02:00
|
|
|
/**
|
2024-01-15 15:59:52 +01:00
|
|
|
* The status of the higher priority session.
|
2018-05-23 15:44:58 +02:00
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
_status?: string;
|
2018-05-23 15:44:58 +02:00
|
|
|
|
2021-05-04 14:54:54 +03:00
|
|
|
/**
|
|
|
|
|
* An object containing the CSS classes.
|
|
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
classes?: { [ key: string]: string; };
|
2021-05-04 14:54:54 +03:00
|
|
|
|
2018-05-23 15:44:58 +02:00
|
|
|
/**
|
|
|
|
|
* The recording mode this indicator should display.
|
|
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
mode: string;
|
|
|
|
|
}
|
2018-05-23 15:44:58 +02:00
|
|
|
|
2018-10-03 11:37:25 +02:00
|
|
|
/**
|
|
|
|
|
* State of the component.
|
|
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
interface IState {
|
2018-10-03 11:37:25 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* True if the label status is stale, so it needs to be removed.
|
|
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
staleLabel: boolean;
|
|
|
|
|
}
|
2018-10-03 11:37:25 +02:00
|
|
|
|
2018-05-23 15:44:58 +02:00
|
|
|
/**
|
|
|
|
|
* Abstract class for the {@code RecordingLabel} component.
|
|
|
|
|
*/
|
2024-01-15 15:59:52 +01:00
|
|
|
export default class AbstractRecordingLabel extends Component<IProps, IState> {
|
2018-06-14 11:15:36 +02:00
|
|
|
/**
|
|
|
|
|
* Implements React {@code Component}'s render.
|
|
|
|
|
*
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
*/
|
|
|
|
|
render() {
|
2024-02-08 15:05:41 +02:00
|
|
|
return this.props._isRecordingRunning && !this.props._iAmRecorder
|
2018-10-03 11:37:25 +02:00
|
|
|
? this._renderLabel() : null;
|
2018-06-14 11:15:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Renders the platform specific label component.
|
|
|
|
|
*
|
|
|
|
|
* @protected
|
|
|
|
|
* @returns {React$Element}
|
|
|
|
|
*/
|
2023-03-21 17:14:17 +02:00
|
|
|
_renderLabel(): React.ReactNode | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2018-05-23 15:44:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Maps (parts of) the Redux state to the associated
|
|
|
|
|
* {@code AbstractRecordingLabel}'s props.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} state - The Redux state.
|
2023-03-21 17:14:17 +02:00
|
|
|
* @param {IProps} ownProps - The component's own props.
|
2018-05-23 15:44:58 +02:00
|
|
|
* @private
|
|
|
|
|
* @returns {{
|
2018-09-11 12:16:01 +02:00
|
|
|
* _status: ?string
|
2018-05-23 15:44:58 +02:00
|
|
|
* }}
|
|
|
|
|
*/
|
2023-04-13 15:49:34 +03:00
|
|
|
export function _mapStateToProps(state: IReduxState, ownProps: any) {
|
2018-05-23 15:44:58 +02:00
|
|
|
const { mode } = ownProps;
|
|
|
|
|
|
|
|
|
|
return {
|
2024-02-08 15:05:41 +02:00
|
|
|
_isRecordingRunning: isRecordingRunning(state),
|
2023-03-30 15:30:15 +03:00
|
|
|
_iAmRecorder: Boolean(state['features/base/config'].iAmRecorder),
|
2024-02-08 13:33:47 +02:00
|
|
|
_isTranscribing: isTranscribing(state),
|
2018-09-11 12:16:01 +02:00
|
|
|
_status: getSessionStatusToShow(state, mode)
|
2018-05-23 15:44:58 +02:00
|
|
|
};
|
|
|
|
|
}
|