import { MarkdownViewer } from '@stoplight/markdown-viewer'; import { Box, Link, Text } from '@stoplight/mosaic'; import * as React from 'react'; export const Description: React.FunctionComponent<{ value: unknown }> = ({ value }) => { const [showAll, setShowAll] = React.useState(false); if (typeof value !== 'string' || value.trim().length === 0) return null; const paragraphs = value.split('\n\n'); if (paragraphs.length <= 1 || showAll) { return ( ); } const firstParagraph = paragraphs[0]; return ( { return ( {props.children} setShowAll(true)}> Show all... ); }, }, }} style={{ fontSize: 12, }} /> ); };