bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/captions/speech/container.jsx

34 lines
844 B
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import CaptionsService from '/imports/ui/components/captions/service';
import Speech from './component';
2023-12-08 03:23:36 +08:00
import { useMutation } from '@apollo/client';
import { SET_SPEECH_LOCALE } from '/imports/ui/core/graphql/mutations/userMutations';
2023-12-08 03:23:36 +08:00
const Container = (props) => {
const [setSpeechLocale] = useMutation(SET_SPEECH_LOCALE);
const setUserSpeechLocale = (locale, provider) => {
setSpeechLocale({
variables: {
locale,
provider,
},
});
};
return <Speech setUserSpeechLocale={setUserSpeechLocale} {...props} />;
};
export default withTracker(({ isModerator }) => {
const {
locale,
dictating,
} = CaptionsService.getDictationStatus(isModerator);
return {
locale,
dictating,
};
})(Container);