import {AbstractModal} from "tc-shared/ui/react-elements/ModalDefinitions"; import {Registry, RegistryMap} from "tc-shared/events"; import {ChannelTreeUIEvents} from "tc-shared/ui/tree/Definitions"; import * as React from "react"; import {ChannelTreeRenderer} from "tc-shared/ui/tree/Renderer"; import {ControlBarEvents} from "tc-shared/ui/frames/control-bar/Definitions"; import {ControlBar2} from "tc-shared/ui/frames/control-bar/Renderer"; import {ChannelTreePopoutEvents} from "tc-shared/ui/tree/popout/Definitions"; import {useState} from "react"; const TitleRenderer = (props: { events: Registry }) => { const [ title, setTitle ] = useState(() => { props.events.fire("query_title"); return tr("Channel tree popout"); }); props.events.reactUse("notify_title", event => setTitle(event.title)); return <>{title}; } const cssStyle = require("./RendererModal.scss"); class ChannelTreeModal extends AbstractModal { readonly eventsUI: Registry; readonly eventsTree: Registry; readonly eventsControlBar: Registry; readonly handlerId: string; constructor(registryMap: RegistryMap, userData: any) { super(); this.handlerId = userData.handlerId; this.eventsUI = registryMap["base"] as any; this.eventsTree = registryMap["tree"] as any; this.eventsControlBar = registryMap["controlBar"] as any; this.eventsUI.fire("query_title"); } protected onDestroy() { super.onDestroy(); } renderBody(): React.ReactElement { return (
) } title(): React.ReactElement { return ; } } export = ChannelTreeModal;