import { View, FlatList, ActivityIndicator } from 'react-native';
import React from 'react';
import { CometChatListItem } from '../CometChatListItem';
export const CometChatSuggestionList = (props) => {
    const { data, avatarStyle, listItemStyle, separatorColor, onPress, onEndReached, loading } = props;
    const _render = ({ item, index }) => {
        let shouldLoadAvatarName = item.hideLeadingIcon ? {} : { avatarName: item.name };
        return (<CometChatListItem key={index} id={item.id} title={item.name} avatarStyle={{ ...avatarStyle }} avatarURL={item.leadingIconUrl ? { uri: item.leadingIconUrl } : undefined} listItemStyle={{ ...listItemStyle }} onPress={() => onPress(item)} {...shouldLoadAvatarName}/>);
    };
    return (<View>
            <FlatList data={data} renderItem={_render} onEndReached={({ distanceFromEnd }) => {
            if (distanceFromEnd < 0)
                return;
            onEndReached();
        }} ItemSeparatorComponent={() => <View style={{ height: 1, marginLeft: 5, backgroundColor: separatorColor }}></View>} onEndReachedThreshold={0.3} keyboardShouldPersistTaps={"always"} style={{
            paddingLeft: 5
        }}/>
            <View style={{
            position: 'absolute',
            bottom: 0,
            width: '100%',
        }}>
                {loading && <ActivityIndicator animating={loading}/>}
            </View>
        </View>);
};
//# sourceMappingURL=CometChatSuggestionList.js.map