({function: func}: FunctionJSDocProps)
| 24 | } |
| 25 | |
| 26 | export function FunctionJSDoc({function: func}: FunctionJSDocProps) { |
| 27 | let examples = Array.isArray(func.examples) ? func.examples.filter(Boolean) : []; |
| 28 | |
| 29 | return ( |
| 30 | <div className={style({marginBottom: 16})}> |
| 31 | <span className={style({font: 'body-lg'})}> |
| 32 | {renderHTMLfromMarkdown(func.description, {forceInline: false, forceBlock: true})} |
| 33 | </span> |
| 34 | {examples.map((example, index) => { |
| 35 | return ( |
| 36 | <div key={index} className={style({marginTop: 12})}> |
| 37 | {examples.length > 1 && ( |
| 38 | <strong className={style({font: 'title-sm'})}>Example {index + 1}:</strong> |
| 39 | )} |
| 40 | <pre className={standaloneCode}> |
| 41 | <Code lang="tsx">{example.trim()}</Code> |
| 42 | </pre> |
| 43 | </div> |
| 44 | ); |
| 45 | })} |
| 46 | </div> |
| 47 | ); |
| 48 | } |
nothing calls this directly
no test coverage detected