import {APIVariable} from '@sanity/tsdoc' import {Box, Card, Label, Text} from '@sanity/ui' import {useMemo} from 'react' import {TSDocSymbol} from '../../app' import {CommentDeprecatedCallout, CommentExampleBlocks, CommentRemarks} from '../../comment' import {H, P} from '../../lib/ui' import {CodeSnippet} from '../CodeSnippet' import {Members} from '../members' import {_getMembers} from '../members/helpers' import {TSVariableParamMember} from '../members/TSVariableParamMember' import {TSDocCode} from '../TSDocCode' export function VariableContent(props: {data: APIVariable}): React.ReactNode { const {data} = props const {comment, isReactComponentType, propsType, type} = data const {parameters = []} = comment || {} const propsTypeMembers = useMemo( () => (isReactComponentType && propsType ? _getMembers(propsType) : undefined), [isReactComponentType, propsType], ) return ( <> {comment && } {isReactComponentType && ( <> Signature > )} {propsType && ( Props Defined by the{' '} {' '} interface. {propsTypeMembers && ( <> {propsTypeMembers.length > 0 && } {propsTypeMembers.length === 0 && ( No members. )} > )} )} {parameters.length > 0 ? ( <> Parameters {parameters.map((param) => ( ))} > ) : null} {!isReactComponentType && type && ( Type )} {comment && } {comment && } > ) }
Defined by the{' '} {' '} interface.
No members.