import React, { useEffect, useState, useCallback } from 'react' import { View, Text, FlatList, StyleSheet, TouchableOpacity, SafeAreaView, ActivityIndicator, Image, } from 'react-native' import { useNavigation, useFocusEffect } from '@react-navigation/native' import type { NativeStackNavigationProp } from '@react-navigation/native-stack' import type { RootStackParams } from '../../navigation/types' import { ImSDK, type FriendRequest, type ImEventListener, type ImMessage } from '@xuqm/rn-sdk' import type { UserProfile } from '../../api/demo' import { toDemoUserProfile } from '../../utils/userProfiles' import { load, save, K } from '../../utils/storage' type Nav = NativeStackNavigationProp function ContactRow({ user, onPress }: { user: UserProfile; onPress(): void }) { const letter = (user.nickname || user.userId).charAt(0).toUpperCase() return ( {user.avatar ? ( ) : ( {letter} )} {user.nickname} @{user.userId} ) } function ContactsEmpty({ loading, onGoSearch }: { loading: boolean; onGoSearch(): void }) { if (loading) return null return ( 还没有联系人 搜索添加 ) } function ContactsSeparator() { return } export default function ContactsScreen() { const navigation = useNavigation