import {APIMember} from '@sanity/tsdoc' import {Box, Text, Tooltip} from '@sanity/ui' import {Level, Size, useTextSize} from '../lib/ui' import {ClassTooltipContent} from './content/ClassTooltipContent' import {EnumTooltipContent} from './content/EnumTooltipContent' import {FunctionTooltipContent} from './content/FunctionTooltipContent' import {InterfaceTooltipContent} from './content/InterfaceTooltipContent' import {TypeAliasTooltipContent} from './content/TypeAliasTooltipContent' import {VariableTooltipContent} from './content/VariableTooltipContent' /** @alpha */ export function ReferenceTooltip(props: { children: React.ReactElement member: APIMember }): React.ReactNode { const {children, member} = props return ( } placement="top" portal > {children} ) } /** @alpha */ export function ReferenceTooltipContent(props: {data: APIMember}): React.ReactNode { const {data} = props const textSize = useTextSize([-1, 0, 1]) if (data._type === 'api.class') { return } if (data._type === 'api.enum') { return } if (data._type === 'api.function') { return } if (data._type === 'api.interface') { return } if (data._type === 'api.typeAlias') { return } if (data._type === 'api.variable') { return } return ( Unknown type: {data._type} ) }