2019-05-17 04:11:10 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2021-10-16 03:07:13 +08:00
|
|
|
import Service from '/imports/ui/components/captions/service';
|
2019-05-17 04:11:10 +08:00
|
|
|
import Captions from './component';
|
2021-10-16 03:07:13 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
|
|
|
import { layoutSelectInput, layoutDispatch } from '../layout/context';
|
|
|
|
import { ACTIONS, PANELS } from '/imports/ui/components/layout/enums';
|
2023-11-30 23:10:36 +08:00
|
|
|
import SpeechService from '/imports/ui/components/audio/captions/speech/service';
|
2019-05-17 04:11:10 +08:00
|
|
|
|
2021-10-16 03:07:13 +08:00
|
|
|
const Container = (props) => {
|
|
|
|
const cameraDock = layoutSelectInput((i) => i.cameraDock);
|
|
|
|
const { isResizing } = cameraDock;
|
|
|
|
const layoutContextDispatch = layoutDispatch();
|
|
|
|
|
|
|
|
return <Captions {...{ layoutContextDispatch, isResizing, ...props }} />;
|
|
|
|
};
|
2019-05-17 04:11:10 +08:00
|
|
|
|
|
|
|
export default withTracker(() => {
|
2021-10-16 03:07:13 +08:00
|
|
|
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
2019-05-17 04:11:10 +08:00
|
|
|
const {
|
2021-10-05 03:22:18 +08:00
|
|
|
locale,
|
2021-10-16 03:07:13 +08:00
|
|
|
name,
|
|
|
|
ownerId,
|
|
|
|
dictating,
|
|
|
|
} = Service.getCaptions();
|
2019-05-17 04:11:10 +08:00
|
|
|
|
|
|
|
return {
|
2021-10-05 03:22:18 +08:00
|
|
|
locale,
|
2021-10-16 03:07:13 +08:00
|
|
|
name,
|
|
|
|
ownerId,
|
|
|
|
dictation: Service.canIDictateThisPad(ownerId),
|
|
|
|
dictating,
|
|
|
|
currentUserId: Auth.userID,
|
|
|
|
isRTL,
|
|
|
|
hasPermission: Service.hasPermission(),
|
|
|
|
amIModerator: Service.amIModerator(),
|
2023-11-30 23:10:36 +08:00
|
|
|
autoTranscription: SpeechService.isEnabled(),
|
2019-05-17 04:11:10 +08:00
|
|
|
};
|
2021-10-16 03:07:13 +08:00
|
|
|
})(Container);
|