UNPKG

@uimkit/uikit-react

Version:

<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>

19 lines (16 loc) 1.7 kB
import React__default from 'react'; import '../../types/models.js'; import '../../types/events.js'; import { UIConversationPreview } from '../UIConversationPreview/UIConversationPreview.js'; import { EmptyStateIndicator } from '../EmptyStateIndicator/EmptyStateIndicator.js'; import { InfiniteScroll } from '../InfiniteScrollPaginator/InfiniteScroll.js'; function UIConversationListView(_a) { var activeConversation = _a.activeConversation, setActiveConversation = _a.setActiveConversation, conversations = _a.conversations, loadMore = _a.loadMore, loading = _a.loading, hasMore = _a.hasMore, Preview = _a.Preview; return (React__default.createElement("div", { className: "conversation-list" }, React__default.createElement(InfiniteScroll, { className: "conversation-list-infinite-scroll", hasMoreNewer: hasMore, loadMoreNewer: loadMore, threshold: 1 }, React__default.createElement("ul", null, (conversations === null || conversations === void 0 ? void 0 : conversations.length) > 0 ? (conversations.map(function (conversation) { return (React__default.createElement(UIConversationPreview, { key: conversation.id, conversation: conversation, activeConversation: activeConversation, setActiveConversation: setActiveConversation, Preview: Preview, conversationUpdateCount: 0 })); })) : React__default.createElement(EmptyStateIndicator, { listType: "conversation" }))), loading && React__default.createElement("p", { className: "loading" }, "\u52A0\u8F7D\u4E2D"), !hasMore && React__default.createElement("p", { className: "no-more" }, "\u6CA1\u6709\u66F4\u591A"))); } export { UIConversationListView }; //# sourceMappingURL=UIConversationListView.js.map