import {TSDocComment as TSDocCommentType} from '@sanity/tsdoc' import {Card, Stack, Text} from '@sanity/ui' import {ObjectInputProps} from 'sanity' import {Blocks} from './Blocks' export function TsdocComment(props: ObjectInputProps): React.ReactNode { const { customBlocks, deprecated, exampleBlocks, // modifierTags, // parameters, // remarks, // returns, seeBlocks, summary, // ...rest } = props.value || {} if (!deprecated && !exampleBlocks && !seeBlocks && !summary) { return ( No comment No extracted tsdoc comment. ) } return ( {deprecated && ( Deprecated )} {summary && } {exampleBlocks && exampleBlocks.length > 0 && exampleBlocks.map((exampleBlock, i) => { return ( Example #{i + 1} ) })} {customBlocks && ( Custom blocks {customBlocks.map((block) => (
{block.tag}
))}
)} {seeBlocks && ( See also {seeBlocks.map((block) => ( ))} )}
) }