2021-10-16 03:07:13 +08:00
|
|
|
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';
|
2021-10-16 03:07:13 +08:00
|
|
|
|
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} />;
|
|
|
|
};
|
2021-10-16 03:07:13 +08:00
|
|
|
|
2023-11-30 21:24:25 +08:00
|
|
|
export default withTracker(({ isModerator }) => {
|
2021-10-16 03:07:13 +08:00
|
|
|
const {
|
|
|
|
locale,
|
|
|
|
dictating,
|
2023-11-30 21:24:25 +08:00
|
|
|
} = CaptionsService.getDictationStatus(isModerator);
|
2021-10-16 03:07:13 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
locale,
|
|
|
|
dictating,
|
|
|
|
};
|
|
|
|
})(Container);
|