bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/captions/writer-menu/container.jsx
2023-11-30 14:24:25 +01:00

23 lines
810 B
JavaScript

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Service from '/imports/ui/components/captions/service';
import WriterMenu from './component';
import { layoutDispatch } from '../../layout/context';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
const WriterMenuContainer = (props) => {
const layoutContextDispatch = layoutDispatch();
const { data: currentUserData } = useCurrentUser((user) => ({
isModerator: user.isModerator,
}));
const amIModerator = currentUserData?.isModerator;
return amIModerator && <WriterMenu {...{ layoutContextDispatch, ...props }} />;
};
export default withTracker(({ setIsOpen }) => ({
closeModal: () => setIsOpen(false),
availableLocales: Service.getAvailableLocales(),
}))(WriterMenuContainer);