import {useCallback} from 'react' import {View} from 'react-native' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' import {type ActiveConvoStates} from '#/state/messages/convo' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {atoms as a, useTheme} from '#/alf' import {LeaveConvoPrompt} from '#/components/dms/LeaveConvoPrompt' import {KnownFollowers} from '#/components/KnownFollowers' import {usePromptControl} from '#/components/Prompt' import {AcceptChatButton, DeleteChatButton, RejectMenu} from './RequestButtons' export function ChatStatusInfo({convoState}: {convoState: ActiveConvoStates}) { const t = useTheme() const {_} = useLingui() const moderationOpts = useModerationOpts() const leaveConvoControl = usePromptControl() const onAcceptChat = useCallback(() => { convoState.markConvoAccepted() }, [convoState]) // either the other person, or the chat owner // if we ever allow someone other than the owner to invite people, this will need to change const otherUser = convoState.convo.primaryMember if (!moderationOpts) { return null } return ( {otherUser && ( )} {otherUser && ( )} ) }