@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
32 lines • 1.16 kB
JavaScript
import * as tslib_1 from "tslib";
import * as React from 'react';
import { PureComponent } from 'react';
import { AkCode } from '@atlaskit/code';
var Code = (function (_super) {
tslib_1.__extends(Code, _super);
function Code() {
return _super !== null && _super.apply(this, arguments) || this;
}
Code.prototype.render = function () {
var children = this.props.children;
if (typeof children === 'string') {
/**
* It could be used like
* <Code>This is the text</Code>
*/
return React.createElement(AkCode, { text: children });
}
if (Array.isArray(children) && typeof children[0] === 'string') {
/**
* The React Serializer would generically wrap all content in an array,
* so it would actually looks like
* <Code>{['This is the text']}</Code>
*/
return React.createElement(AkCode, { text: children[0] });
}
return React.createElement(AkCode, { text: '' });
};
return Code;
}(PureComponent));
export default Code;
//# sourceMappingURL=code.js.map