import * as React from 'react'; import { StoryConfig } from '../../typings/story-config'; import { ExampleSection, SectionType } from '../../typings/story-section'; import { sectionWithSiblings } from '../section-with-siblings'; import { SkeletonRectangle } from '../../SkeletonRectangle/SkeletonRectangle'; import { code, description } from '..'; import { description as descriptionView } from './description'; import { code as codeView } from './code'; import { Layout, Cell } from '../../ui/Layout'; export const example = ( section: ExampleSection, storyConfig: StoryConfig, ): React.ReactNode => { const { wide, loading } = section; return ( {sectionWithSiblings( description({ ...section, loading: false, type: SectionType.Description, }), descriptionView({ ...section, size: wide ? 'small' : 'normal' }), true, )} {loading ? ( ) : ( sectionWithSiblings(code(section), codeView(section, storyConfig)) )} ); };