import {SanityArrayItem, SerializedAPIToken} from '@sanity/tsdoc' import {Card, Code as UICode} from '@sanity/ui' import {ArrayOfObjectsInputProps} from 'sanity' import {IntentLink} from 'sanity/router' import {styled} from 'styled-components' const Code = styled(UICode)` & a { color: var(--card-link-color); &:hover { text-decoration: underline; } } ` export function APITokensInput( props: ArrayOfObjectsInputProps>, ): React.ReactNode { const {value = []} = props return ( {value.length > 0 && value.map((token) => )} {value.length === 0 && ' '} ) } function TokenPreview({token}: {token: SanityArrayItem}) { if (token.member?._ref) { return ( {token.text} ) } return <>{token.text} }