import React from 'react'; import Toggle from '/imports/ui/components/common/switch/component'; import { defineMessages, injectIntl } from 'react-intl'; import BaseMenu from '../base/component'; import Styled from './styles'; import { SETTINGS } from '/imports/ui/services/settings/enums'; const intlMessages = defineMessages({ transcriptionLabel: { id: 'app.submenu.transcription.sectionTitle', }, transcriptionDesc: { id: 'app.submenu.transcription.desc', }, partialUtterancesLabel: { id: 'app.settings.transcriptionTab.partialUtterances', }, minUtteranceLengthLabel: { id: 'app.settings.transcriptionTab.minUtteranceLength', }, }); class Transcription extends BaseMenu { constructor(props) { super(props); this.state = { settingsName: SETTINGS.TRANSCRIPTION, settings: props.settings, }; } render() { const { intl, showToggleLabel, displaySettingsStatus } = this.props; const { partialUtterances, minUtteranceLength } = this.state.settings; return (
{intl.formatMessage(intlMessages.transcriptionLabel)} {intl.formatMessage(intlMessages.transcriptionDesc)}
{intl.formatMessage(intlMessages.partialUtterancesLabel)} this.handleToggle('partialUtterances')} ariaLabelledBy="partialUtterances" ariaLabel={`${intl.formatMessage( intlMessages.partialUtterancesLabel, )} - ${displaySettingsStatus(partialUtterances, true)}`} showToggleLabel={showToggleLabel} /> {intl.formatMessage(intlMessages.minUtteranceLengthLabel)} this.handleInput('minUtteranceLength', e)} type="number" max="5" min="0" />
); } } export default injectIntl(Transcription);