import * as React from 'react'; import { StoryConfig } from '../../../typings/story-config'; import { ImportExampleSection } from '../../../typings/story-section'; import { importString } from '../../../StoryPage/import-string'; import { SkeletonRectangle } from '../../../SkeletonRectangle/SkeletonRectangle'; import { Code } from './Code'; export const importExample: ( a: ImportExampleSection, b: StoryConfig, ) => React.ReactNode = ({ dataHook = '', source, loading }, storyConfig) => loading ? ( ) : typeof source === 'string' ? ( {source.trim()} ) : ( source || ( {importString({ metadata: storyConfig.metadata, config: storyConfig.config, exampleImport: storyConfig.exampleImport, })} ) );