import {UIElement} from "../UIElement"; import {UIEventSource} from "../../Logic/UIEventSource"; import {LayoutConfigJson} from "../../Customizations/JSON/LayoutConfigJson"; import Combine from "../Base/Combine"; import {VariableUiElement} from "../Base/VariableUIElement"; export default class SharePanel extends UIElement { private _config: UIEventSource; private _panel: UIElement; constructor(config: UIEventSource, liveUrl: UIEventSource) { super(undefined); this._config = config; const json = new VariableUiElement(config.map(config => { return JSON.stringify(config, null, 2) .replace(/\n/g, "
") .replace(/ /g, " "); })); this._panel = new Combine([ "

share

", "Share the following link with friends:
", new VariableUiElement(liveUrl.map(url => `${url}`)), "

Json

", "The json configuration is included for debugging purposes", "
", json, "
" ]); } InnerRender(): string { return this._panel.Render(); } }