import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Keyboard, KeyboardAvoidingView, Platform, StyleSheet, TouchableWithoutFeedback, View, } from 'react-native' import { useFocusEffect, useNavigation, useRoute, type RouteProp } from '@react-navigation/native' import type { NativeStackNavigationProp } from '@react-navigation/native-stack' import { SafeAreaView } from 'react-native-safe-area-context' import { useTranslation } from 'react-i18next' import { CustomNavbar } from '@tencentcloud/chat-uikit-react-native' import { MessageList, MessageInput, type MessageInfo, showToast} from '@tencentcloud/chat-uikit-react-native' import { useConversationListState, useGroupState, useLoginState, } from 'tuikit-atomicx-react-native' const MessageType = { TEXT: 1, IMAGE: 2, VIDEO: 3, AUDIO: 4, FILE: 5, CUSTOM: 6, } as const interface OfflinePushContext { messageType: number messagePayload: any conversationID: string } interface OfflinePushInfo { title: string description: string extensionInfo: { ext: string } } type RootStackParamList = { Chat: { conversationID: string type: 'C2C' | 'GROUP' title?: string locateMessage?: MessageInfo | null } ChatSetting: { conversationID: string; type: 'C2C' | 'GROUP' } ConversationList: undefined Login: undefined } type Nav = NativeStackNavigationProp type Rt = RouteProp export const ChatScreen: React.FC = () => { const route = useRoute() const navigation = useNavigation