@droppii-org/chat-sdk 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/images/searchEmpty.png +0 -0
  2. package/dist/components/conversation-detail/ConversationDetailInput.d.ts.map +1 -1
  3. package/dist/components/conversation-detail/ConversationDetailInput.js +142 -4
  4. package/dist/components/conversation-detail/LeaveGroupBlockedModal.d.ts +12 -0
  5. package/dist/components/conversation-detail/LeaveGroupBlockedModal.d.ts.map +1 -0
  6. package/dist/components/conversation-detail/LeaveGroupBlockedModal.js +18 -0
  7. package/dist/components/conversation-detail/LeaveGroupConfirmModal.d.ts +16 -0
  8. package/dist/components/conversation-detail/LeaveGroupConfirmModal.d.ts.map +1 -0
  9. package/dist/components/conversation-detail/LeaveGroupConfirmModal.js +21 -0
  10. package/dist/components/conversation-detail/ThreadProfilePanel.d.ts.map +1 -1
  11. package/dist/components/conversation-detail/ThreadProfilePanel.js +12 -2
  12. package/dist/components/conversation-detail/index.d.ts +4 -0
  13. package/dist/components/conversation-detail/index.d.ts.map +1 -1
  14. package/dist/components/conversation-detail/index.js +2 -0
  15. package/dist/components/conversation-detail/mention/BizMentionMenu.d.ts +15 -0
  16. package/dist/components/conversation-detail/mention/BizMentionMenu.d.ts.map +1 -0
  17. package/dist/components/conversation-detail/mention/BizMentionMenu.js +11 -0
  18. package/dist/components/conversation-detail/mention/buildMentionPayload.d.ts +4 -0
  19. package/dist/components/conversation-detail/mention/buildMentionPayload.d.ts.map +1 -0
  20. package/dist/components/conversation-detail/mention/buildMentionPayload.js +23 -0
  21. package/dist/components/conversation-detail/mention/getCaretCoordinates.d.ts +11 -0
  22. package/dist/components/conversation-detail/mention/getCaretCoordinates.d.ts.map +1 -0
  23. package/dist/components/conversation-detail/mention/getCaretCoordinates.js +36 -0
  24. package/dist/components/conversation-detail/mention/useMentionTokens.d.ts +21 -0
  25. package/dist/components/conversation-detail/mention/useMentionTokens.d.ts.map +1 -0
  26. package/dist/components/conversation-detail/mention/useMentionTokens.js +58 -0
  27. package/dist/components/conversation-detail/mention/useMentionTrigger.d.ts +7 -0
  28. package/dist/components/conversation-detail/mention/useMentionTrigger.d.ts.map +1 -0
  29. package/dist/components/conversation-detail/mention/useMentionTrigger.js +19 -0
  30. package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts +4 -1
  31. package/dist/components/conversation-inbox/ConversationInboxHeader.d.ts.map +1 -1
  32. package/dist/components/conversation-inbox/ConversationInboxHeader.js +3 -2
  33. package/dist/components/conversation-inbox/contact-search/ContactSearchFilters.d.ts +8 -0
  34. package/dist/components/conversation-inbox/contact-search/ContactSearchFilters.d.ts.map +1 -0
  35. package/dist/components/conversation-inbox/contact-search/ContactSearchFilters.js +19 -0
  36. package/dist/components/conversation-inbox/contact-search/ContactSearchPanel.d.ts +7 -0
  37. package/dist/components/conversation-inbox/contact-search/ContactSearchPanel.d.ts.map +1 -0
  38. package/dist/components/conversation-inbox/contact-search/ContactSearchPanel.js +116 -0
  39. package/dist/components/conversation-inbox/contact-search/ContactSearchResultItem.d.ts +9 -0
  40. package/dist/components/conversation-inbox/contact-search/ContactSearchResultItem.d.ts.map +1 -0
  41. package/dist/components/conversation-inbox/contact-search/ContactSearchResultItem.js +34 -0
  42. package/dist/components/conversation-inbox/contact-search/ContactSearchSectionHeader.d.ts +8 -0
  43. package/dist/components/conversation-inbox/contact-search/ContactSearchSectionHeader.d.ts.map +1 -0
  44. package/dist/components/conversation-inbox/contact-search/ContactSearchSectionHeader.js +7 -0
  45. package/dist/components/conversation-inbox/contact-search/ContactSearchStateMessage.d.ts +8 -0
  46. package/dist/components/conversation-inbox/contact-search/ContactSearchStateMessage.d.ts.map +1 -0
  47. package/dist/components/conversation-inbox/contact-search/ContactSearchStateMessage.js +9 -0
  48. package/dist/components/conversation-inbox/contact-search/ContactSearchTabs.d.ts +10 -0
  49. package/dist/components/conversation-inbox/contact-search/ContactSearchTabs.d.ts.map +1 -0
  50. package/dist/components/conversation-inbox/contact-search/ContactSearchTabs.js +39 -0
  51. package/dist/components/conversation-inbox/contact-search/ContactSearchViewMoreBar.d.ts +6 -0
  52. package/dist/components/conversation-inbox/contact-search/ContactSearchViewMoreBar.d.ts.map +1 -0
  53. package/dist/components/conversation-inbox/contact-search/ContactSearchViewMoreBar.js +9 -0
  54. package/dist/components/conversation-inbox/contact-search/constants.d.ts +18 -0
  55. package/dist/components/conversation-inbox/contact-search/constants.d.ts.map +1 -0
  56. package/dist/components/conversation-inbox/contact-search/constants.js +23 -0
  57. package/dist/components/conversation-inbox/contact-search/index.d.ts +10 -0
  58. package/dist/components/conversation-inbox/contact-search/index.d.ts.map +1 -0
  59. package/dist/components/conversation-inbox/contact-search/index.js +9 -0
  60. package/dist/components/conversation-inbox/contact-search/utils.d.ts +6 -0
  61. package/dist/components/conversation-inbox/contact-search/utils.d.ts.map +1 -0
  62. package/dist/components/conversation-inbox/contact-search/utils.js +44 -0
  63. package/dist/components/message/footer/mention/useMentionOptions.d.ts +1 -0
  64. package/dist/components/message/footer/mention/useMentionOptions.d.ts.map +1 -1
  65. package/dist/components/message/footer/mention/useMentionOptions.js +1 -1
  66. package/dist/components/search-conversation/SearchAll.d.ts.map +1 -1
  67. package/dist/components/search-conversation/SearchAll.js +9 -3
  68. package/dist/components/search-conversation/SearchConversationAsGroups.d.ts +6 -0
  69. package/dist/components/search-conversation/SearchConversationAsGroups.d.ts.map +1 -0
  70. package/dist/components/search-conversation/SearchConversationAsGroups.js +20 -0
  71. package/dist/components/search-conversation/index.d.ts +2 -1
  72. package/dist/components/search-conversation/index.d.ts.map +1 -1
  73. package/dist/components/search-conversation/index.js +7 -0
  74. package/dist/components/search-conversation/item/SearchItemAsGroup.d.ts +8 -0
  75. package/dist/components/search-conversation/item/SearchItemAsGroup.d.ts.map +1 -0
  76. package/dist/components/search-conversation/item/SearchItemAsGroup.js +34 -0
  77. package/dist/constants/images.d.ts +1 -0
  78. package/dist/constants/images.d.ts.map +1 -1
  79. package/dist/constants/images.js +2 -0
  80. package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
  81. package/dist/hooks/global/useGlobalEvent.js +11 -1
  82. package/dist/hooks/group/useConversationGroups.d.ts +5 -1
  83. package/dist/hooks/group/useConversationGroups.d.ts.map +1 -1
  84. package/dist/hooks/group/useConversationGroups.js +3 -3
  85. package/dist/hooks/group/useLeaveGroupAction.d.ts +24 -0
  86. package/dist/hooks/group/useLeaveGroupAction.d.ts.map +1 -0
  87. package/dist/hooks/group/useLeaveGroupAction.js +79 -0
  88. package/dist/hooks/group/useQuitGroup.d.ts +6 -0
  89. package/dist/hooks/group/useQuitGroup.d.ts.map +1 -0
  90. package/dist/hooks/group/useQuitGroup.js +62 -0
  91. package/dist/hooks/search/useSearchContacts.d.ts +18 -0
  92. package/dist/hooks/search/useSearchContacts.d.ts.map +1 -0
  93. package/dist/hooks/search/useSearchContacts.js +39 -0
  94. package/dist/hooks/search/useSearchGroups.d.ts +16 -0
  95. package/dist/hooks/search/useSearchGroups.d.ts.map +1 -0
  96. package/dist/hooks/search/useSearchGroups.js +65 -0
  97. package/dist/locales/vi/common.json +3 -0
  98. package/dist/locales/vi/conversation-inbox.json +36 -2
  99. package/dist/screens/conversation-inbox/index.d.ts.map +1 -1
  100. package/dist/screens/conversation-inbox/index.js +14 -3
  101. package/dist/services/query.d.ts +2 -0
  102. package/dist/services/query.d.ts.map +1 -1
  103. package/dist/services/query.js +2 -0
  104. package/dist/services/routes.d.ts +2 -0
  105. package/dist/services/routes.d.ts.map +1 -1
  106. package/dist/services/routes.js +2 -0
  107. package/dist/store/conversation.d.ts.map +1 -1
  108. package/dist/store/conversation.js +3 -0
  109. package/dist/store/type.d.ts +2 -0
  110. package/dist/store/type.d.ts.map +1 -1
  111. package/dist/styles/global.css +1 -1
  112. package/dist/types/dto.d.ts +29 -1
  113. package/dist/types/dto.d.ts.map +1 -1
  114. package/dist/types/dto.js +10 -1
  115. package/package.json +2 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchConversationAsGroups.d.ts","sourceRoot":"","sources":["../../../src/components/search-conversation/SearchConversationAsGroups.tsx"],"names":[],"mappings":"AAQA,UAAU,+BAA+B;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,0BAA0B,GAAI,OAAO,+BAA+B,4CA0CzE,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Empty, Spin } from "antd";
4
+ import { useTranslation } from "react-i18next";
5
+ import InfiniteScroll from "react-infinite-scroll-component";
6
+ import SearchItemAsGroup from "./item/SearchItemAsGroup";
7
+ import { useSearchGroups } from "../../hooks/search/useSearchGroups";
8
+ const SearchConversationAsGroups = (props) => {
9
+ const { searchTerm = "" } = props;
10
+ const { t } = useTranslation();
11
+ const { groups, hasNextPage, fetchNextPage, isLoading } = useSearchGroups({
12
+ searchTerm,
13
+ });
14
+ if ((groups.length === 0 && !isLoading) || searchTerm.trim() === "")
15
+ return _jsx(Empty, { description: t("no_conversation") });
16
+ if (isLoading)
17
+ return (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Spin, {}) }));
18
+ return (_jsx("div", { id: "scrollableSearchGroupsTab", className: "h-full overflow-auto", "data-cp-name": "SearchConversationAsGroups", children: _jsx(InfiniteScroll, { dataLength: groups.length, next: fetchNextPage, hasMore: hasNextPage, loader: _jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) }), scrollableTarget: "scrollableSearchGroupsTab", children: groups.map((item) => (_jsx(SearchItemAsGroup, { group: item, searchTerm: searchTerm }, item.conversationId))) }) }));
19
+ };
20
+ export default SearchConversationAsGroups;
@@ -2,7 +2,8 @@ export declare enum SearchConversationTabKey {
2
2
  All = "all",
3
3
  MyInbox = "myInbox",
4
4
  Users = "users",
5
- Messages = "messages"
5
+ Messages = "messages",
6
+ Groups = "groups"
6
7
  }
7
8
  interface SearchConversationProps {
8
9
  searchTerm: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search-conversation/index.tsx"],"names":[],"mappings":"AAUA,oBAAY,wBAAwB;IAClC,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;CACtB;AAED,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,kBAAkB,GAAI,gBAAgB,uBAAuB,4CAgDlE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/search-conversation/index.tsx"],"names":[],"mappings":"AAWA,oBAAY,wBAAwB;IAClC,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,kBAAkB,GAAI,gBAAgB,uBAAuB,4CAqDlE,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -7,12 +7,14 @@ import SearchConversationAll from "./SearchAll";
7
7
  import SearchConversationMyInbox from "./SearchConversationMyInbox";
8
8
  import SearchConversationAsUsers from "./SearchConversationAsUsers";
9
9
  import SearchConversationAsMessages from "./SearchConversationAsMessages";
10
+ import SearchConversationAsGroups from "./SearchConversationAsGroups";
10
11
  export var SearchConversationTabKey;
11
12
  (function (SearchConversationTabKey) {
12
13
  SearchConversationTabKey["All"] = "all";
13
14
  SearchConversationTabKey["MyInbox"] = "myInbox";
14
15
  SearchConversationTabKey["Users"] = "users";
15
16
  SearchConversationTabKey["Messages"] = "messages";
17
+ SearchConversationTabKey["Groups"] = "groups";
16
18
  })(SearchConversationTabKey || (SearchConversationTabKey = {}));
17
19
  const SearchConversation = ({ searchTerm }) => {
18
20
  const { t } = useTranslation();
@@ -39,6 +41,11 @@ const SearchConversation = ({ searchTerm }) => {
39
41
  label: t("messages"),
40
42
  children: _jsx(SearchConversationAsMessages, { searchTerm: searchTerm }),
41
43
  },
44
+ {
45
+ key: SearchConversationTabKey.Groups,
46
+ label: t("groups"),
47
+ children: _jsx(SearchConversationAsGroups, { searchTerm: searchTerm }),
48
+ },
42
49
  ];
43
50
  }, [t, searchTerm]);
44
51
  return (_jsx("div", { className: "h-full", "data-cp-name": "SearchConversation", children: _jsx(Tabs, { defaultActiveKey: SearchConversationTabKey.All, items: items, className: "h-full", activeKey: activeKey, onChange: (key) => setActiveKey(key), destroyOnHidden: true }) }));
@@ -0,0 +1,8 @@
1
+ import type { ConversationGroupDisplayItem } from "../../../hooks/group/useConversationGroups";
2
+ interface SearchItemAsGroupProps {
3
+ group: ConversationGroupDisplayItem;
4
+ searchTerm: string;
5
+ }
6
+ declare const SearchItemAsGroup: (props: SearchItemAsGroupProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default SearchItemAsGroup;
8
+ //# sourceMappingURL=SearchItemAsGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchItemAsGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/search-conversation/item/SearchItemAsGroup.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAOxF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,4BAA4B,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,GAAI,OAAO,sBAAsB,4CAgEvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useTranslation } from "react-i18next";
4
+ import { GroupVisibility } from "@droppii-org/wasm-client-sdk";
5
+ import useConversationStore from "../../../store/conversation";
6
+ import { useChatContext } from "../../../context/ChatContext";
7
+ import { highlightSearch, sanitizeHtml } from "../../../utils/common";
8
+ import { Icon } from "../../../components/icon";
9
+ import GroupCompositeAvatar from "../../../components/group/GroupCompositeAvatar";
10
+ const SearchItemAsGroup = (props) => {
11
+ const { group, searchTerm = "" } = props;
12
+ const { t } = useTranslation();
13
+ const { onNavigate } = useChatContext();
14
+ const setConversationData = useConversationStore((state) => state.setConversationData);
15
+ const setSelectedConversationId = useConversationStore((state) => state.setSelectedConversationId);
16
+ const { conversation } = group;
17
+ const isPublic = group.visibility === GroupVisibility.Public;
18
+ const onPressItem = () => {
19
+ setConversationData(conversation);
20
+ setSelectedConversationId(conversation.conversationID);
21
+ const newSearchParams = new URLSearchParams(window.location.search);
22
+ newSearchParams.set("threadId", conversation.conversationID);
23
+ newSearchParams.delete("userId");
24
+ newSearchParams.delete("groupId");
25
+ newSearchParams.delete("botId");
26
+ onNavigate === null || onNavigate === void 0 ? void 0 : onNavigate(`${window.location.pathname}?${newSearchParams.toString()}`);
27
+ };
28
+ return (_jsxs("div", { className: "py-3 px-2 flex items-center gap-3 hover:bg-gray-100 hover:rounded-sm cursor-pointer border-b mx-1", onClick: onPressItem, "data-cp-name": "SearchItemAsGroup", children: [_jsx(GroupCompositeAvatar, { groupID: group.groupId, faceURL: conversation.faceURL, groupName: conversation.showName, size: 48 }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0 gap-0.5", children: [_jsx("p", { className: "text-sm font-semibold truncate", dangerouslySetInnerHTML: {
29
+ __html: sanitizeHtml(highlightSearch(conversation.showName || "", searchTerm)),
30
+ } }), _jsxs("div", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [_jsxs("span", { className: "flex items-center gap-0.5", children: [_jsx(Icon, { icon: isPublic ? "globe-o" : "lock-o", size: 12 }), isPublic
31
+ ? t("group_visibility_public")
32
+ : t("group_visibility_private")] }), typeof group.memberCount === "number" && (_jsxs(_Fragment, { children: [_jsx("span", { children: "\u00B7" }), _jsx("span", { children: t("member_count", { count: group.memberCount }) })] }))] })] })] }));
33
+ };
34
+ export default SearchItemAsGroup;
@@ -3,5 +3,6 @@ export declare const images: {
3
3
  imageFailed: string;
4
4
  emptyResources: string;
5
5
  muteNotificationWarning: string;
6
+ searchEmpty: string;
6
7
  };
7
8
  //# sourceMappingURL=images.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/constants/images.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC"}
1
+ {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/constants/images.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAC"}
@@ -3,9 +3,11 @@ const imageFailed = new URL("../assets/images/imageFailed.png", import.meta.url)
3
3
  .href;
4
4
  const emptyResources = new URL("../assets/images/emptyResources.png", import.meta.url).href;
5
5
  const muteNotificationWarning = new URL("../assets/images/muteNotificationWarning.png", import.meta.url).href;
6
+ const searchEmpty = new URL("../assets/images/searchEmpty.png", import.meta.url).href;
6
7
  export const images = {
7
8
  conversationBg,
8
9
  imageFailed,
9
10
  emptyResources,
10
11
  muteNotificationWarning,
12
+ searchEmpty,
11
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,cAAc,YAmhB1B,CAAC"}
1
+ {"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,cAAc,YA6hB1B,CAAC"}
@@ -252,7 +252,13 @@ export const useGlobalEvent = () => {
252
252
  const leftGroupHandler = (data, reason) => {
253
253
  const currentConversation = useConversationStore.getState().currentConversation;
254
254
  const isCurrentGroupOpen = (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.groupID) === data.groupID;
255
- const staysViewOnly = reason === "kicked" && data.visibility === GroupVisibility.Public;
255
+ // A voluntary leave arrives as OnJoinedGroupDeleted on the leaver's own
256
+ // client too. It must not fall into the public-group view-only branch —
257
+ // AC-6 requires navigating to My Inbox regardless of visibility.
258
+ const isSelfLeave = useConversationStore.getState().selfLeftGroupID === data.groupID;
259
+ const staysViewOnly = !isSelfLeave &&
260
+ reason === "kicked" &&
261
+ data.visibility === GroupVisibility.Public;
256
262
  // The kicked/disbanded group's own cached membership is stale the
257
263
  // instant this event fires, whether or not it's currently open —
258
264
  // nonMemberGroupID guards against a still-in-flight fetch resurrecting
@@ -275,6 +281,10 @@ export const useGlobalEvent = () => {
275
281
  if (selfDisbandedGroupID === data.groupID) {
276
282
  useConversationStore.getState().setSelfDisbandedGroupID(null);
277
283
  }
284
+ else if (isSelfLeave) {
285
+ // The leaver chose this — useQuitGroup already navigates and toasts.
286
+ useConversationStore.getState().setSelfLeftGroupID(null);
287
+ }
278
288
  else {
279
289
  useConversationStore.getState().showRemovedFromGroupModal();
280
290
  }
@@ -1,4 +1,4 @@
1
- import { ConversationItem } from "@droppii-org/wasm-client-sdk";
1
+ import { ConversationItem, GroupVisibility } from "@droppii-org/wasm-client-sdk";
2
2
  import { BaseResponse, IConversationGroupItem } from "../../types/dto";
3
3
  interface UseConversationGroupsParams {
4
4
  enabled?: boolean;
@@ -8,7 +8,11 @@ export interface ConversationGroupDisplayItem {
8
8
  groupId: string;
9
9
  conversationId: string;
10
10
  conversation: ConversationItem;
11
+ visibility?: GroupVisibility;
12
+ memberCount?: number;
11
13
  }
14
+ export declare const buildFallbackConversation: (group: IConversationGroupItem) => ConversationItem;
15
+ export declare const syncGroupConversationsToStore: (groups: IConversationGroupItem[]) => Promise<void>;
12
16
  export declare const useConversationGroups: ({ enabled, pageSize, }?: UseConversationGroupsParams) => {
13
17
  groups: ConversationGroupDisplayItem[];
14
18
  fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<IConversationGroupItem[]>, unknown>, Error>>;
@@ -1 +1 @@
1
- {"version":3,"file":"useConversationGroups.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useConversationGroups.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAe,MAAM,8BAA8B,CAAC;AAK7E,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAKnE,UAAU,2BAA2B;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;CAChC;AAiED,eAAO,MAAM,qBAAqB,GAAI,yBAGnC,2BAAgC;;;;;;CAoElC,CAAC"}
1
+ {"version":3,"file":"useConversationGroups.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useConversationGroups.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,gBAAgB,EAChB,eAAe,EAEhB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAKnE,UAAU,2BAA2B;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,gBAAgB,CAAC;IAG/B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,yBAAyB,GACpC,OAAO,sBAAsB,KAC5B,gBAyBD,CAAC;AAMH,eAAO,MAAM,6BAA6B,GACxC,QAAQ,sBAAsB,EAAE,kBAuBjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,yBAGnC,2BAAgC;;;;;;CAoElC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { useMemo } from "react";
3
3
  import { useInfiniteQuery } from "@tanstack/react-query";
4
- import { SessionType } from "@droppii-org/wasm-client-sdk";
4
+ import { SessionType, } from "@droppii-org/wasm-client-sdk";
5
5
  import { apiInstance } from "../../services/api";
6
6
  import { ENDPOINTS } from "../../services/routes";
7
7
  import { QUERY_KEYS } from "../../services/query";
@@ -13,7 +13,7 @@ import { DChatSDK } from "../../constants/sdk";
13
13
  // a brand new group (e.g. right after create-group, or first time this list
14
14
  // loads) — carries just enough for ConversationByGroupItem to render
15
15
  // something instead of the row disappearing while the sync is in flight.
16
- const buildFallbackConversation = (group) => ({
16
+ export const buildFallbackConversation = (group) => ({
17
17
  conversationID: group.conversationId,
18
18
  conversationType: SessionType.Group,
19
19
  userID: "",
@@ -43,7 +43,7 @@ const buildFallbackConversation = (group) => ({
43
43
  // metadata (no latestMsg) — sync each group's full ConversationItem (which
44
44
  // carries latestMsg/latestMsgSendTime/unreadCount) into the shared
45
45
  // conversationList store via the SDK, then join on conversationId.
46
- const syncGroupConversationsToStore = async (groups) => {
46
+ export const syncGroupConversationsToStore = async (groups) => {
47
47
  const currentList = useConversationStore.getState().conversationList;
48
48
  const newGroups = groups.filter((group) => !currentList.some((conversation) => conversation.conversationID === group.conversationId));
49
49
  if (!newGroups.length)
@@ -0,0 +1,24 @@
1
+ interface UseLeaveGroupActionParams {
2
+ groupID?: string;
3
+ conversationID?: string;
4
+ isGroupThread: boolean;
5
+ onLeft?: () => void;
6
+ }
7
+ /**
8
+ * Owns the "Rời nhóm" flow: who may leave, which modal opens, and the
9
+ * quitGroup call itself. Kept out of the panel so the panel stays
10
+ * presentational as more group-info rows land from sibling tickets.
11
+ */
12
+ export declare const useLeaveGroupAction: ({ groupID, conversationID, isGroupThread, onLeft, }: UseLeaveGroupActionParams) => {
13
+ canLeaveGroup: boolean;
14
+ isPublicGroup: boolean;
15
+ isLeaving: boolean;
16
+ isConfirmOpen: boolean;
17
+ isBlockedOpen: boolean;
18
+ openLeaveGroup: () => void;
19
+ confirmLeaveGroup: () => Promise<void>;
20
+ closeConfirm: () => void;
21
+ closeBlocked: () => void;
22
+ };
23
+ export {};
24
+ //# sourceMappingURL=useLeaveGroupAction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLeaveGroupAction.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useLeaveGroupAction.ts"],"names":[],"mappings":"AAUA,UAAU,yBAAyB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,qDAKjC,yBAAyB;;;;;;;;;;CA+E3B,CAAC"}
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { useState } from "react";
3
+ import { message } from "antd";
4
+ import { useTranslation } from "react-i18next";
5
+ import { GroupMemberRole, GroupVisibility } from "@droppii-org/wasm-client-sdk";
6
+ import useConversationStore from "../../store/conversation";
7
+ import useAuthStore from "../../store/auth";
8
+ import { useQuitGroup } from "./useQuitGroup";
9
+ /**
10
+ * Owns the "Rời nhóm" flow: who may leave, which modal opens, and the
11
+ * quitGroup call itself. Kept out of the panel so the panel stays
12
+ * presentational as more group-info rows land from sibling tickets.
13
+ */
14
+ export const useLeaveGroupAction = ({ groupID, conversationID, isGroupThread, onLeft, }) => {
15
+ const { t } = useTranslation("conversation-inbox");
16
+ const currentGroupInfo = useConversationStore((state) => groupID ? state.currentGroupInfo.get(groupID) : undefined);
17
+ const currentMemberInGroup = useConversationStore((state) => groupID ? state.currentMemberInGroup.get(groupID) : undefined);
18
+ const isViewOnlyMember = useConversationStore((state) => state.isViewOnlyMember);
19
+ // useAuthStore.userID is the canonical self ID here (ChatContext populates
20
+ // it on init). useUserStore.selfInfo is never filled in this host, so its
21
+ // `id` is undefined — which is also why roleLevel below stays undefined.
22
+ const selfUserID = useAuthStore((state) => state.userID);
23
+ const { mutateAsync: quitGroup, isPending: isLeaving } = useQuitGroup();
24
+ const [isConfirmOpen, setIsConfirmOpen] = useState(false);
25
+ const [isBlockedOpen, setIsBlockedOpen] = useState(false);
26
+ // Only a current member of a group thread can leave it. A view-only member
27
+ // of a public group already left / was removed, so the row stays hidden.
28
+ // currentGroupInfo is required too: without it we can classify neither the
29
+ // owner (who must be blocked) nor the visibility (which picks the copy), and
30
+ // guessing either way is worse than waiting for the fetch.
31
+ const canLeaveGroup = isGroupThread &&
32
+ !!groupID &&
33
+ !!currentMemberInGroup &&
34
+ !!currentGroupInfo &&
35
+ !isViewOnlyMember;
36
+ // ownerUserID is the reliable source. roleLevel is not: it comes only from
37
+ // getCurrentMemberInGroupByReq, which queries by useUserStore.selfInfo.id —
38
+ // undefined in this host — so the member entry is written by
39
+ // getSelfGroupPermissionByReq instead and carries no roleLevel at all.
40
+ // Kept as a fallback for hosts that do populate selfInfo.
41
+ const isGroupOwner = (currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.ownerUserID) && selfUserID
42
+ ? currentGroupInfo.ownerUserID === selfUserID
43
+ : (currentMemberInGroup === null || currentMemberInGroup === void 0 ? void 0 : currentMemberInGroup.roleLevel) === GroupMemberRole.Owner;
44
+ const isPublicGroup = (currentGroupInfo === null || currentGroupInfo === void 0 ? void 0 : currentGroupInfo.visibility) === GroupVisibility.Public;
45
+ // The owner must transfer ownership first (BR-002) — they get the blocking
46
+ // modal instead of the confirmation one, and nothing changes.
47
+ const openLeaveGroup = () => {
48
+ if (isGroupOwner) {
49
+ setIsBlockedOpen(true);
50
+ return;
51
+ }
52
+ setIsConfirmOpen(true);
53
+ };
54
+ const confirmLeaveGroup = async () => {
55
+ if (!groupID) {
56
+ return;
57
+ }
58
+ try {
59
+ await quitGroup({ groupID, conversationID, isPublicGroup });
60
+ setIsConfirmOpen(false);
61
+ onLeft === null || onLeft === void 0 ? void 0 : onLeft();
62
+ message.success(t("thread_detail.leave_group.success"));
63
+ }
64
+ catch (_error) {
65
+ message.error(t("thread_detail.leave_group.failed"));
66
+ }
67
+ };
68
+ return {
69
+ canLeaveGroup,
70
+ isPublicGroup,
71
+ isLeaving,
72
+ isConfirmOpen,
73
+ isBlockedOpen,
74
+ openLeaveGroup,
75
+ confirmLeaveGroup,
76
+ closeConfirm: () => setIsConfirmOpen(false),
77
+ closeBlocked: () => setIsBlockedOpen(false),
78
+ };
79
+ };
@@ -0,0 +1,6 @@
1
+ export declare const useQuitGroup: () => import("@tanstack/react-query").UseMutationResult<unknown, Error, {
2
+ groupID: string;
3
+ conversationID?: string;
4
+ isPublicGroup?: boolean;
5
+ }, unknown>;
6
+ //# sourceMappingURL=useQuitGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQuitGroup.d.ts","sourceRoot":"","sources":["../../../src/hooks/group/useQuitGroup.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY;aASV,MAAM;qBACE,MAAM;oBACP,OAAO;WA6D5B,CAAC"}
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import { useMutation } from "@tanstack/react-query";
3
+ import { DChatSDK } from "../../constants/sdk";
4
+ import useConversationStore from "../../store/conversation";
5
+ import emitter from "../../utils/events";
6
+ import { useChatContext } from "../../context/ChatContext";
7
+ export const useQuitGroup = () => {
8
+ const { onNavigate } = useChatContext();
9
+ return useMutation({
10
+ mutationFn: async ({ groupID, conversationID, isPublicGroup, }) => {
11
+ // Set before the request — OnJoinedGroupDeleted also fires on our own
12
+ // client, with no ordering guarantee vs. this promise resolving. Without
13
+ // the flag leftGroupHandler would show the "removed from group" modal.
14
+ useConversationStore.getState().setSelfLeftGroupID(groupID);
15
+ const { data } = await DChatSDK.quitGroup(groupID);
16
+ // A public group stays in My Inbox after leaving — the user keeps
17
+ // view-only access to it, same as leftGroupHandler's staysViewOnly path.
18
+ //
19
+ // A private one must disappear, and that needs an explicit local
20
+ // cleanup: the server drops the membership but the wasm SDK keeps the
21
+ // row in its local DB, and My Inbox reads from there
22
+ // (getConversationListSplit), so the group returns on the next reload.
23
+ // hideConversation is the only SDK call that drops the row from that
24
+ // list — deleteConversationAndDeleteAllMsg just wipes the messages and
25
+ // leaves the conversation behind. Best-effort: the leave already
26
+ // succeeded server-side, and OnJoinedGroupDeleted may have cleaned up
27
+ // first, which makes this reject with RecordNotFound.
28
+ if (conversationID && !isPublicGroup) {
29
+ try {
30
+ await DChatSDK.hideConversation(conversationID);
31
+ }
32
+ catch (error) {
33
+ console.error("Failed to hide the local conversation after leaving the group:", error);
34
+ }
35
+ }
36
+ emitter.emit("GROUP_MEMBERS_CHANGED");
37
+ return data;
38
+ },
39
+ onSuccess: (_data, variables) => {
40
+ useConversationStore.getState().clearSelectedConversation();
41
+ // Same rule as above: only a private group leaves the inbox.
42
+ if (!variables.isPublicGroup) {
43
+ useConversationStore.setState((state) => ({
44
+ conversationList: state.conversationList.filter((conversation) => conversation.groupID !== variables.groupID),
45
+ }));
46
+ }
47
+ // Clearing the store alone won't navigate away — URL threadId must
48
+ // also clear, or DeskConversationList re-selects it (see PR #226).
49
+ const newSearchParams = new URLSearchParams(window.location.search);
50
+ newSearchParams.delete("threadId");
51
+ newSearchParams.delete("userId");
52
+ newSearchParams.delete("groupId");
53
+ newSearchParams.delete("botId");
54
+ const query = newSearchParams.toString();
55
+ const pathname = window.location.pathname;
56
+ onNavigate === null || onNavigate === void 0 ? void 0 : onNavigate(query ? `${pathname}?${query}` : pathname);
57
+ },
58
+ onError: () => {
59
+ useConversationStore.getState().setSelfLeftGroupID(null);
60
+ },
61
+ });
62
+ };
@@ -0,0 +1,18 @@
1
+ import type { BaseResponse, ContactSearchItem, ContactSearchType } from "../../types/dto";
2
+ interface UseSearchContactsParams {
3
+ searchTerm: string;
4
+ type?: ContactSearchType;
5
+ enabled?: boolean;
6
+ pageSize?: number;
7
+ }
8
+ export declare const useSearchContacts: ({ searchTerm, type, enabled, pageSize, }: UseSearchContactsParams) => {
9
+ contacts: ContactSearchItem[];
10
+ totalElements: number;
11
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<ContactSearchItem[]>, unknown>, Error>>;
12
+ hasNextPage: boolean;
13
+ isFetchingNextPage: boolean;
14
+ isLoading: boolean;
15
+ isError: boolean;
16
+ };
17
+ export {};
18
+ //# sourceMappingURL=useSearchContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchContacts.d.ts","sourceRoot":"","sources":["../../../src/hooks/search/useSearchContacts.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EAElB,MAAM,aAAa,CAAC;AAErB,UAAU,uBAAuB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,GAAI,0CAK/B,uBAAuB;;;;;;;;CA+CzB,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { useInfiniteQuery } from "@tanstack/react-query";
4
+ import { apiInstance } from "../../services/api";
5
+ import { ENDPOINTS } from "../../services/routes";
6
+ import { QUERY_KEYS } from "../../services/query";
7
+ import { PAGE_SIZE } from "../../constants";
8
+ import useAuthStore from "../../store/auth";
9
+ export const useSearchContacts = ({ searchTerm, type, enabled = true, pageSize = PAGE_SIZE.medium, }) => {
10
+ var _a, _b, _c, _d;
11
+ const trimmedSearchTerm = searchTerm.trim();
12
+ const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading, isError } = useInfiniteQuery({
13
+ initialPageParam: 1,
14
+ queryKey: [QUERY_KEYS.SEARCH_CONTACTS, trimmedSearchTerm, type, pageSize],
15
+ queryFn: async ({ pageParam = 1 }) => {
16
+ const payload = Object.assign({ applicationType: useAuthStore.getState().applicationType, searchTerm: trimmedSearchTerm, page: pageParam, pageSize }, (type ? { type } : {}));
17
+ const res = await apiInstance.post(ENDPOINTS.chatService.searchContacts, payload);
18
+ return res.data;
19
+ },
20
+ getNextPageParam: (lastPage) => {
21
+ var _a, _b;
22
+ const dataLength = ((_a = lastPage === null || lastPage === void 0 ? void 0 : lastPage.data) === null || _a === void 0 ? void 0 : _a.length) || 0;
23
+ const currentPage = ((_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage.pageable) === null || _b === void 0 ? void 0 : _b.pageNumber) || 1;
24
+ return dataLength < pageSize ? undefined : currentPage + 1;
25
+ },
26
+ enabled: enabled && trimmedSearchTerm !== "",
27
+ });
28
+ const contacts = useMemo(() => { var _a, _b; return (_b = (_a = data === null || data === void 0 ? void 0 : data.pages) === null || _a === void 0 ? void 0 : _a.flatMap((page) => { var _a; return (_a = page === null || page === void 0 ? void 0 : page.data) !== null && _a !== void 0 ? _a : []; })) !== null && _b !== void 0 ? _b : []; }, [data]);
29
+ const totalElements = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.pages) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.pageable) === null || _c === void 0 ? void 0 : _c.totalElements) !== null && _d !== void 0 ? _d : 0;
30
+ return {
31
+ contacts,
32
+ totalElements,
33
+ fetchNextPage,
34
+ hasNextPage,
35
+ isFetchingNextPage,
36
+ isLoading,
37
+ isError,
38
+ };
39
+ };
@@ -0,0 +1,16 @@
1
+ import { BaseResponse, IConversationGroupItem } from "../../types/dto";
2
+ import { type ConversationGroupDisplayItem } from "../../hooks/group/useConversationGroups";
3
+ interface UseSearchGroupsParams {
4
+ searchTerm: string;
5
+ enabled?: boolean;
6
+ pageSize?: number;
7
+ }
8
+ export declare const useSearchGroups: ({ searchTerm, enabled, pageSize, }: UseSearchGroupsParams) => {
9
+ groups: ConversationGroupDisplayItem[];
10
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<BaseResponse<IConversationGroupItem[]>, unknown>, Error>>;
11
+ hasNextPage: boolean;
12
+ isFetchingNextPage: boolean;
13
+ isLoading: boolean;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=useSearchGroups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchGroups.d.ts","sourceRoot":"","sources":["../../../src/hooks/search/useSearchGroups.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,qCAAqC,CAAC;AAE7C,UAAU,qBAAqB;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,GAAI,oCAI7B,qBAAqB;;;;;;CAmEvB,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { useMemo } from "react";
3
+ import { useInfiniteQuery } from "@tanstack/react-query";
4
+ import { apiInstance } from "../../services/api";
5
+ import { ENDPOINTS } from "../../services/routes";
6
+ import { QUERY_KEYS } from "../../services/query";
7
+ import { PAGE_SIZE } from "../../constants";
8
+ import useAuthStore from "../../store/auth";
9
+ import useConversationStore from "../../store/conversation";
10
+ import { buildFallbackConversation, syncGroupConversationsToStore, } from "../../hooks/group/useConversationGroups";
11
+ export const useSearchGroups = ({ searchTerm, enabled = true, pageSize = PAGE_SIZE.medium, }) => {
12
+ const trimmedSearchTerm = searchTerm.trim();
13
+ const conversationList = useConversationStore((state) => state.conversationList);
14
+ const { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = useInfiniteQuery({
15
+ initialPageParam: 1,
16
+ queryKey: [QUERY_KEYS.SEARCH_CONVERSATION_GROUPS, trimmedSearchTerm, pageSize],
17
+ queryFn: async ({ pageParam = 1 }) => {
18
+ var _a, _b;
19
+ const applicationType = useAuthStore.getState().applicationType;
20
+ const res = await apiInstance.get(ENDPOINTS.chatService.searchConversationGroups, {
21
+ params: {
22
+ page: pageParam,
23
+ pageSize,
24
+ applicationType,
25
+ searchTerm: trimmedSearchTerm,
26
+ },
27
+ });
28
+ if ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.length) {
29
+ void syncGroupConversationsToStore(res.data.data).catch((error) => {
30
+ console.error("syncGroupConversationsToStore", error);
31
+ });
32
+ }
33
+ return res.data;
34
+ },
35
+ getNextPageParam: (lastPage) => {
36
+ var _a, _b;
37
+ const dataLength = ((_a = lastPage === null || lastPage === void 0 ? void 0 : lastPage.data) === null || _a === void 0 ? void 0 : _a.length) || 0;
38
+ const currentPage = ((_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage.pageable) === null || _b === void 0 ? void 0 : _b.pageNumber) || 1;
39
+ return dataLength < pageSize ? undefined : currentPage + 1;
40
+ },
41
+ enabled: enabled && trimmedSearchTerm !== "",
42
+ });
43
+ const groups = useMemo(() => {
44
+ if (!data)
45
+ return [];
46
+ const allItems = data.pages.flatMap((page) => page.data);
47
+ return allItems.map((group) => {
48
+ const syncedConversation = conversationList === null || conversationList === void 0 ? void 0 : conversationList.find((conversation) => conversation.conversationID === group.conversationId);
49
+ return {
50
+ groupId: group.groupId,
51
+ conversationId: group.conversationId,
52
+ conversation: syncedConversation !== null && syncedConversation !== void 0 ? syncedConversation : buildFallbackConversation(group),
53
+ visibility: group.visibility,
54
+ memberCount: group.memberCount,
55
+ };
56
+ });
57
+ }, [data, conversationList]);
58
+ return {
59
+ groups,
60
+ fetchNextPage,
61
+ hasNextPage,
62
+ isFetchingNextPage,
63
+ isLoading,
64
+ };
65
+ };
@@ -17,6 +17,9 @@
17
17
  "all": "Tất cả",
18
18
  "users": "Người dùng",
19
19
  "messages": "Tin nhắn",
20
+ "groups": "Nhóm",
21
+ "group_visibility_private": "Riêng tư",
22
+ "group_visibility_public": "Công khai",
20
23
  "no_conversation": "Không tìm thấy cuộc trò chuyện",
21
24
  "download": "Tải xuống",
22
25
  "active_sessions": "Đang mở",
@@ -99,11 +99,45 @@
99
99
  "cancel": "Tiếp tục",
100
100
  "close_failed": "Không thể kết thúc phiên hỗ trợ. Vui lòng thử lại."
101
101
  }
102
+ },
103
+ "leave_group": {
104
+ "action": "Rời nhóm",
105
+ "confirm_title": "Rời nhóm?",
106
+ "confirm_desc_private": "Sau khi rời nhóm, bạn sẽ không thể xem tin nhắn từ cuộc trò chuyện này nữa. Bạn có chắc chắn muốn <bold>rời khỏi nhóm</bold>?",
107
+ "confirm_desc_public": "Sau khi rời nhóm, bạn sẽ không thể nhắn tin hay nhận thông báo từ cuộc trò chuyện này nữa. Bạn có chắc chắn muốn <bold>rời khỏi nhóm</bold>?",
108
+ "confirm_primary": "Rời nhóm",
109
+ "confirm_secondary": "Ở lại nhóm",
110
+ "blocked_title": "Không thể rời nhóm",
111
+ "blocked_desc": "Bạn không thể rời nhóm khi đang là chủ nhóm, vui lòng chuyển quyền chủ nhóm cho thành viên khác và thử lại!",
112
+ "blocked_confirm": "Đã hiểu",
113
+ "success": "Bạn đã rời khỏi nhóm",
114
+ "failed": "Không thể rời nhóm. Vui lòng thử lại."
102
115
  }
103
116
  },
104
117
  "link_preview": {
105
118
  "loading": "Đang tải xem trước liên kết...",
106
119
  "remove": "Xóa xem trước liên kết"
107
120
  },
108
- "link_open_error": "Không thể mở liên kết. Vui lòng thử lại."
109
- }
121
+ "link_open_error": "Không thể mở liên kết. Vui lòng thử lại.",
122
+ "contact_search": {
123
+ "back": "Quay lại",
124
+ "tabs": {
125
+ "all": "Tất cả",
126
+ "contacts": "Liên hệ",
127
+ "messages": "Tin nhắn"
128
+ },
129
+ "view_all": "Xem tất cả",
130
+ "initial": "Bạn có thể tìm kiếm theo liên hệ hoặc nội dung tin nhắn",
131
+ "no_result_title": "Không tìm thấy kết quả nào",
132
+ "no_result_hint": "Hãy thử lại với cách viết hoặc kết hợp cụm từ khác phù hợp hơn.",
133
+ "failed": "Không tải được kết quả. Vui lòng thử lại",
134
+ "messages_not_available": "Tìm kiếm tin nhắn sẽ được bổ sung sau",
135
+ "member_count": "{{count}} thành viên",
136
+ "filters": {
137
+ "customer": "Khách hàng",
138
+ "pdp": "PDP",
139
+ "group": "Nhóm",
140
+ "seller": "Người bán"
141
+ }
142
+ }
143
+ }