import React from "react"; import { View, Text, TouchableOpacity, FlatList } from "react-native"; import { User } from "@replyke/core"; import { UserAvatar, UserMentionSkeleton } from "@replyke/ui-core-react-native"; interface MentionSuggestionsProps { isMentionActive: boolean; isLoadingMentions: boolean; mentionSuggestions: User[]; handleMentionClick: (user: User) => void; } const MentionSuggestions: React.FC = ({ isMentionActive, isLoadingMentions, mentionSuggestions, handleMentionClick, }) => { if (!isMentionActive) return null; return ( {isLoadingMentions ? ( `loading-${item}`} renderItem={() => } ItemSeparatorComponent={() => } keyboardShouldPersistTaps="always" /> ) : ( item.id} keyboardShouldPersistTaps="always" renderItem={({ item }) => ( handleMentionClick(item)} style={{ flexDirection: "row", alignItems: "center", paddingVertical: 8, }} > {item.username} {item.name && ( {item.name} )} )} /> )} ); }; export default MentionSuggestions;