bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/presentation-toast/presentation-uploader-toast/container.jsx

38 lines
1011 B
React
Raw Normal View History

import React from 'react';
import { PresentationUploaderToast } from './component';
import {
2023-10-20 02:56:13 +08:00
EXPORTING_PRESENTATIONS_SUBSCRIPTION,
} from '/imports/ui/components/whiteboard/queries';
import useDeduplicatedSubscription from '/imports/ui/core/hooks/useDeduplicatedSubscription';
const PresentationUploaderToastContainer = (props) => {
const {
data: presentationData,
loading: presentationLoading,
} = useDeduplicatedSubscription(
EXPORTING_PRESENTATIONS_SUBSCRIPTION,
);
const presentations = presentationData?.pres_presentation || [];
const convertingPresentations = presentations.filter(
(p) => (!p.uploadCompleted || !!p.uploadErrorMsgKey),
);
if (presentationLoading) return null;
if (!presentations.length) return null;
return (
<PresentationUploaderToast
{
...{
presentations: presentations.filter((p) => p),
convertingPresentations,
...props,
}
}
/>
);
};
export default PresentationUploaderToastContainer;