import { Pressable, View } from 'react-native'; import { useColors } from '../../hook'; import { usePaletteContext, useThemeContext } from '../../theme'; import { Alert } from '../../ui/Alert'; import { CmnButton } from '../../ui/Button'; import { Icon } from '../../ui/Image'; import { CommonSwitch } from '../../ui/Switch'; import { SingleLineText } from '../../ui/Text'; import { SimpleToast } from '../../ui/Toast'; import { Avatar } from '../Avatar'; import { BackButton } from '../Back'; import { BottomSheetNameMenu } from '../BottomSheetMenu'; import { ListItem } from '../ListItem'; import { TopNavigationBar } from '../TopNavigationBar'; import { BlockButtons } from './BlockButtons'; import { useGroupParticipantInfo } from './GroupParticipantInfo.hooks'; import type { GroupParticipantInfoProps } from './types'; /** * Group Participant Info Component. * * If it is a contact, the send message button is displayed, otherwise the add contact button is displayed. */ export function GroupParticipantInfo(props: GroupParticipantInfoProps) { const { onBack, onClickedNavigationBarButton: onMore, hasAudioCall = false, hasSendMessage = true, hasVideoCall = false, onClearChat, containerStyle, navigationBarVisible, customNavigationBar, } = props; const { doNotDisturb, onDoNotDisturb, userId, userName, userAvatar, onCopyId, toastRef, tr, onSendMessage, onAddContact, onAudioCall, onVideoCall, isContact, onInitButton, isSelf, onRequestCloseMenu, menuRef, alertRef, } = useGroupParticipantInfo(props); const { cornerRadius } = useThemeContext(); const { input } = cornerRadius; const { colors } = usePaletteContext(); const { getColor } = useColors({ t3: { light: colors.neutral[7], dark: colors.neutral[6], }, }); return ( {navigationBarVisible !== false ? ( customNavigationBar ? ( <>{customNavigationBar} ) : ( } Right={ } /> ) ) : null} {userName ?? userId} {userId} {isContact === true ? ( ) : isSelf === true ? null : ( )} {isContact === true ? ( <> {tr('_uikit_info_not_disturb')} } RightIcon={ {doNotDisturb !== undefined ? ( ) : null} } /> {tr('_uikit_info_clear_msg')} } /> ) : null} ); }