@uiw/react-md-editor
Version:
A markdown editor with preview, implemented with React.js and TypeScript.
25 lines (24 loc) • 861 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import React from 'react';
import "./Child.css";
import Toolbar from './';
export default function Child(props) {
var _ref = props || {},
prefixCls = _ref.prefixCls,
_ref$active = _ref.active,
active = _ref$active === void 0 ? {} : _ref$active,
groupName = _ref.groupName,
commands = _ref.commands,
children = _ref.children;
return /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-toolbar-child ").concat(groupName && active[groupName] ? 'active' : ''),
onClick: function onClick(e) {
return e.stopPropagation();
}
}, Array.isArray(commands) ? /*#__PURE__*/React.createElement(Toolbar, _extends({
commands: commands
}, props, {
groupName: groupName
})) : children);
}
//# sourceMappingURL=Child.js.map