bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/audio-test/component.jsx
Vitor Mateus De Almeida 145ca61d40 linting some files
2021-08-09 11:24:02 -03:00

56 lines
1.2 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Button from '/imports/ui/components/button/component';
import { defineMessages, injectIntl } from 'react-intl';
import { styles } from './styles.scss';
const propTypes = {
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
handlePlayAudioSample: PropTypes.func.isRequired,
outputDeviceId: PropTypes.string,
};
const defaultProps = {
outputDeviceId: null,
};
const intlMessages = defineMessages({
playSoundLabel: {
id: 'app.audio.playSoundLabel',
description: 'Play sound button label',
},
});
class AudioTest extends React.Component {
constructor(props) {
super(props);
this.handlePlayAudioSample = props.handlePlayAudioSample.bind(this);
}
render() {
const {
outputDeviceId,
intl,
} = this.props;
return (
<Button
className={styles.testAudioBtn}
label={intl.formatMessage(intlMessages.playSoundLabel)}
icon="unmute"
size="sm"
color="primary"
onClick={() => this.handlePlayAudioSample(outputDeviceId)}
/>
);
}
}
AudioTest.propTypes = propTypes;
AudioTest.defaultProps = defaultProps;
export default injectIntl(AudioTest);