UNPKG

@alilc/lowcode-editor-core

Version:

Core Api for Ali lowCode engine

38 lines 1.31 kB
import _Icon from "@alifd/next/lib/icon"; import { Tip } from './tip'; export function HelpTip(_ref) { var help = _ref.help, _ref$direction = _ref.direction, direction = _ref$direction === void 0 ? 'top' : _ref$direction, _ref$size = _ref.size, size = _ref$size === void 0 ? 'small' : _ref$size; if (typeof help === 'string') { return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Icon, { type: "help", size: size, className: "lc-help-tip" }), /*#__PURE__*/React.createElement(Tip, { direction: direction }, help)); } if (typeof help === 'object' && help.url) { return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", { href: help.url, target: "_blank", rel: "noopener noreferrer" }, /*#__PURE__*/React.createElement(_Icon, { type: "help", size: size, className: "lc-help-tip" })), /*#__PURE__*/React.createElement(Tip, { direction: direction }, help.content)); } return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Icon, { type: "help", size: "small", className: "lc-help-tip" }), /*#__PURE__*/React.createElement(Tip, { direction: direction }, help.content)); }