bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/floating-window/container.tsx
Guilherme Pereira Leme 6fdd613639
feat(plugin) - Floating window (#19283)
* [plugin-sdk-issue-26] - floating window

* [plugin-sdk-floating-window] - changes in review

* [plugin-sdk-floating-window] - changes in review

* [plugin-sdk-floating-window] - update SDK
2023-12-15 14:04:33 -03:00

34 lines
1.1 KiB
TypeScript

import * as React from 'react';
import { useContext } from 'react';
import FloatingWindow from './component';
import * as PluginSdk from 'bigbluebutton-html-plugin-sdk';
import { PluginsContext } from '/imports/ui/components/components-data/plugin-context/context';
const FloatingWindowContainer = () => {
const {
pluginsExtensibleAreasAggregatedState,
} = useContext(PluginsContext);
let floatingWindows = [] as PluginSdk.FloatingWindowInterface[];
if (pluginsExtensibleAreasAggregatedState.floatingWindows) {
floatingWindows = [
...pluginsExtensibleAreasAggregatedState.floatingWindows,
];
}
return floatingWindows.map((item: PluginSdk.FloatingWindowInterface) => {
const itemToRender: PluginSdk.FloatingWindow = item as PluginSdk.FloatingWindow;
return (
<FloatingWindow
key={itemToRender.id}
top={itemToRender.top}
left={itemToRender.left}
backgroundColor={itemToRender.backgroundColor}
boxShadow={itemToRender.boxShadow}
renderFunction={itemToRender.contentFunction}
isDraggable={itemToRender.movable}
/>
);
});
};
export default FloatingWindowContainer;