import { View } from "react-native"; import { FlatList } from "react-native"; import { Comment as CommentType, useCommentSection } from "@replyke/core"; import { useSocialStyleConfig } from "@replyke/comments-social-core"; import { Comment } from "./Comment"; import CommentsFooterComponent from "./CommentsFooterComponent"; const LoadedComments = ({ data }: { data: CommentType[] }) => { const { loadMore, highlightedComment } = useCommentSection(); const { styleConfig } = useSocialStyleConfig(); const { commentsGap } = styleConfig!.commentFeedProps; return ( } ListHeaderComponent={ highlightedComment ? ( ) : null } ListHeaderComponentStyle={{ paddingBottom: commentsGap }} keyExtractor={(item) => item.id} ItemSeparatorComponent={() => } style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 24 }} keyboardShouldPersistTaps="always" onEndReached={() => data.length > 0 && loadMore!()} onEndReachedThreshold={0} ListFooterComponent={} /> ); }; export default LoadedComments;