import React from 'react' import {View} from 'react-native' import {AppBskyActorDefs} from '@atproto/api' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useMaybeConvoForUser} from '#/state/queries/messages/get-convo-for-members' import {atoms as a, useTheme} from '#/alf' import {Message_Stroke2_Corner0_Rounded as Message} from '../icons/Message' import {Link} from '../Link' import {canBeMessaged} from './util' export function MessageProfileButton({ profile, }: { profile: AppBskyActorDefs.ProfileView }) { const {_} = useLingui() const t = useTheme() const {data: convoId, isPending} = useMaybeConvoForUser(profile.did) if (isPending) { // show pending state based on declaration if (canBeMessaged(profile)) { return ( ) } else { return null } } if (convoId) { return ( ) } else { return null } }