import PropTypes from 'prop-types'; import React from 'react'; import {defineMessages, injectIntl, intlShape} from 'react-intl'; import Box from '../box/box.jsx'; import Meter from '../meter/meter.jsx'; import Waveform from '../waveform/waveform.jsx'; import styles from './record-modal.css'; import stopIcon from './icon--stop-recording.svg'; const messages = defineMessages({ beginRecord: { defaultMessage: 'Begin recording by clicking the button below', description: 'Message for recording sound modal', id: 'gui.recordingStep.beginRecord' }, permission: { defaultMessage: '{arrow}We need your permission to use your microphone', description: 'Permission required notice in recording sound modal. Do not translate {arrow}', id: 'gui.recordingStep.permission' }, stop: { defaultMessage: 'Stop recording', description: 'Stop recording button label', id: 'gui.recordingStep.stop' }, record: { defaultMessage: 'Record', description: 'Record button label', id: 'gui.recordingStep.record' } }); const RecordingStep = props => ( {props.levels ? ( ) : ( {props.listening ? props.intl.formatMessage(messages.beginRecord) : props.intl.formatMessage(messages.permission, {arrow: props.isRtl ? '↗️ \u00A0' : '↖️ \u00A0'} ) } )} ); RecordingStep.propTypes = { intl: intlShape.isRequired, isRtl: PropTypes.bool, level: PropTypes.number, levels: PropTypes.arrayOf(PropTypes.number), listening: PropTypes.bool, onRecord: PropTypes.func.isRequired, onStopRecording: PropTypes.func.isRequired, recording: PropTypes.bool }; export default injectIntl(RecordingStep);