UNPKG

wix-style-react

Version:
34 lines (29 loc) 1.08 kB
import React from 'react'; import PropTypes from 'prop-types'; import CodeBlock from 'wix-storybook-utils/CodeBlock'; import Markdown from 'wix-storybook-utils/Markdown'; var apiReadme = function apiReadme(name) { return '\n## API\nSee the full api <a href="https://wix.github.io/wix-ui-backoffice/?selectedKind=Components&selectedStory=' + name + '">here</a>\n'; }; var ExternalModuleReferer = function ExternalModuleReferer(_ref) { var name = _ref.name, example = _ref.example; return React.createElement( 'div', null, React.createElement(Markdown, { source: '# `<' + name + '/>`' }), React.createElement(CodeBlock, { source: 'import ' + name + ' from \'wix-style-react/' + name + '\';' }), example ? React.createElement( 'div', null, React.createElement(Markdown, { source: '## Example' }), example ) : null, React.createElement(Markdown, { source: apiReadme(name) }) ); }; ExternalModuleReferer.propTypes = { name: PropTypes.string, example: PropTypes.node }; export default ExternalModuleReferer;