wix-storybook-utils
Version:
Utilities for automated component documentation within Storybook
13 lines • 830 B
JavaScript
import * as React from 'react';
import { importString } from '../../../StoryPage/import-string';
import { SkeletonRectangle } from '../../../SkeletonRectangle/SkeletonRectangle';
import { Code } from './Code';
export var importExample = function (_a, storyConfig) {
var _b = _a.dataHook, dataHook = _b === void 0 ? '' : _b, source = _a.source, loading = _a.loading;
return loading ? (React.createElement(SkeletonRectangle, { height: "73px", margin: "0 0 54px 0" })) : typeof source === 'string' ? (React.createElement(Code, { "data-hook": dataHook }, source.trim())) : (source || (React.createElement(Code, { "data-hook": dataHook }, importString({
metadata: storyConfig.metadata,
config: storyConfig.config,
exampleImport: storyConfig.exampleImport,
}))));
};
//# sourceMappingURL=index.js.map