UNPKG

@intuitionrobotics/live-docs

Version:
43 lines 1.64 kB
"use strict"; /* * Permissions management system, define access level for each of * your server apis, and restrict users by giving them access levels * * Copyright (C) 2020 Intuition Robotics * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.LiveDoc = void 0; const frontend_1 = require("@intuitionrobotics/thunderstorm/frontend"); const React = require("react"); const LiveDocsModule_1 = require("../modules/LiveDocsModule"); const showLiveDoc = (e) => { const docKey = frontend_1.BaseComponent.getElementId(e); LiveDocsModule_1.LiveDocsModule.showLiveDoc(docKey); }; class LiveDoc extends React.Component { constructor(props) { super(props); this.state = {}; } render() { const Component = this.props.component; return (React.createElement("div", { className: `clickable`, id: this.props.docKey, style: { display: "inline-block" }, onClick: showLiveDoc }, Component || "Click Here")); } } exports.LiveDoc = LiveDoc; LiveDoc.defaultProps = { component: "?" }; //# sourceMappingURL=LiveDoc.js.map