import * as React from "react"; import {ControlBar2} from "tc-shared/ui/frames/control-bar/Renderer"; import {Registry} from "tc-shared/events"; import {ControlBarEvents} from "tc-shared/ui/frames/control-bar/Definitions"; import {ConnectionListUIEvents} from "tc-shared/ui/frames/connection-handler-list/Definitions"; import {ConnectionHandlerList} from "tc-shared/ui/frames/connection-handler-list/Renderer"; import {ErrorBoundary} from "tc-shared/ui/react-elements/ErrorBoundary"; import {ContextDivider} from "tc-shared/ui/react-elements/ContextDivider"; import {SideBarRenderer} from "tc-shared/ui/frames/SideBarRenderer"; import {SideBarEvents} from "tc-shared/ui/frames/SideBarDefinitions"; import {SideHeaderEvents} from "tc-shared/ui/frames/side/HeaderDefinitions"; import {ServerLogFrame} from "tc-shared/ui/frames/log/Renderer"; import {ServerEventLogUiEvents} from "tc-shared/ui/frames/log/Definitions"; import {FooterRenderer} from "tc-shared/ui/frames/footer/Renderer"; import {HostBanner} from "tc-shared/ui/frames/HostBannerRenderer"; import {HostBannerUiEvents} from "tc-shared/ui/frames/HostBannerDefinitions"; import {AppUiEvents} from "tc-shared/ui/AppDefinitions"; import {useEffect, useState} from "react"; import {ChannelTreeRenderer} from "tc-shared/ui/tree/Renderer"; import {ChannelTreeUIEvents} from "tc-shared/ui/tree/Definitions"; const cssStyle = require("./AppRenderer.scss"); /*
*/ const VideoFrame = React.memo((props: { events: Registry }) => { const refElement = React.useRef(); const [ container, setContainer ] = useState(() => { props.events.fire("query_video_container"); return undefined; }); props.events.reactUse("notify_video_container", event => setContainer(event.container)); useEffect(() => { if(!refElement.current || !container) { return; } refElement.current.replaceWith(container); return () => container.replaceWith(refElement.current); }); if(!container) { return null; } return
; }); const ChannelTree = React.memo((props: { events: Registry }) => { const [ data, setData ] = useState<{ events: Registry, handlerId: string }>(() => { props.events.fire("query_channel_tree"); return undefined; }); props.events.reactUse("notify_channel_tree", event => { setData({ events: event.events, handlerId: event.handlerId }); }, undefined, []); if(!data?.events) { return null; } return ; }); export const TeaAppMainView = (props: { events: Registry controlBar: Registry, connectionList: Registry, sidebar: Registry, sidebarHeader: Registry, log: Registry, hostBanner: Registry }) => { return (
); } /* ConnectionHandlerList */