@messenger-box/platform-mobile 10.0.3-alpha.36 → 10.0.3-alpha.37

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 (34) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/lib/screens/inbox/components/CachedImage/index.js +125 -93
  3. package/lib/screens/inbox/components/CachedImage/index.js.map +1 -1
  4. package/lib/screens/inbox/components/DialogsListItem.js +75 -271
  5. package/lib/screens/inbox/components/DialogsListItem.js.map +1 -1
  6. package/lib/screens/inbox/components/ServiceDialogsListItem.js +184 -415
  7. package/lib/screens/inbox/components/ServiceDialogsListItem.js.map +1 -1
  8. package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js +0 -2
  9. package/lib/screens/inbox/components/SlackMessageContainer/SlackBubble.js.map +1 -1
  10. package/lib/screens/inbox/containers/ConversationView.js +478 -944
  11. package/lib/screens/inbox/containers/ConversationView.js.map +1 -1
  12. package/lib/screens/inbox/containers/Dialogs.js +212 -628
  13. package/lib/screens/inbox/containers/Dialogs.js.map +1 -1
  14. package/lib/screens/inbox/containers/ThreadConversationView.js +409 -1364
  15. package/lib/screens/inbox/containers/ThreadConversationView.js.map +1 -1
  16. package/package.json +3 -3
  17. package/src/screens/inbox/components/CachedImage/index.tsx +191 -140
  18. package/src/screens/inbox/components/DialogsListItem.tsx +104 -368
  19. package/src/screens/inbox/components/ServiceDialogsListItem.tsx +69 -377
  20. package/src/screens/inbox/components/SlackMessageContainer/SlackBubble.tsx +2 -4
  21. package/src/screens/inbox/containers/ConversationView.tsx +660 -1060
  22. package/src/screens/inbox/containers/ConversationView.tsx.bk +1467 -0
  23. package/src/screens/inbox/containers/Dialogs.tsx +301 -763
  24. package/src/screens/inbox/containers/ThreadConversationView.tsx +661 -1887
  25. package/lib/screens/inbox/components/workflow/dialogs-list-item-xstate.js +0 -175
  26. package/lib/screens/inbox/components/workflow/dialogs-list-item-xstate.js.map +0 -1
  27. package/lib/screens/inbox/components/workflow/service-dialogs-list-item-xstate.js +0 -191
  28. package/lib/screens/inbox/components/workflow/service-dialogs-list-item-xstate.js.map +0 -1
  29. package/lib/screens/inbox/containers/workflow/conversation-xstate.js +0 -380
  30. package/lib/screens/inbox/containers/workflow/conversation-xstate.js.map +0 -1
  31. package/lib/screens/inbox/containers/workflow/dialogs-xstate.js +0 -211
  32. package/lib/screens/inbox/containers/workflow/dialogs-xstate.js.map +0 -1
  33. package/lib/screens/inbox/containers/workflow/thread-conversation-xstate.js +0 -438
  34. package/lib/screens/inbox/containers/workflow/thread-conversation-xstate.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import React__default,{useRef,useCallback,useEffect,useState,useMemo}from'react';import {Box,FlatList,Center,Spinner,Text,Heading,Input,InputField}from'@admin-layout/gluestack-ui-mobile';import {Ionicons}from'@expo/vector-icons';import {useSelector}from'react-redux';import {useRoute,useNavigation,useFocusEffect}from'@react-navigation/native';import {orderBy}from'lodash-es';import {DialogsListItem}from'../components/DialogsListItem.js';import {ServiceDialogsListItem}from'../components/ServiceDialogsListItem.js';import {useGetChannelsByUserWithServiceChannelsQuery,OnChatMessageAddedDocument}from'common/graphql';import {RoomType}from'common';import {userSelector}from'@adminide-stack/user-auth0-client';import {config}from'../config/config.js';import colors from'tailwindcss/colors';import'./workflow/dialogs-xstate.js';var __defProp = Object.defineProperty;
1
+ import React__default,{useState,useRef,useCallback,useEffect}from'react';import {Box,FlatList,Center,Spinner,Text,Heading,Input,InputField}from'@admin-layout/gluestack-ui-mobile';import {Ionicons}from'@expo/vector-icons';import {useSelector}from'react-redux';import {useRoute,useNavigation,useFocusEffect}from'@react-navigation/native';import {DialogsListItem}from'../components/DialogsListItem.js';import {ServiceDialogsListItem}from'../components/ServiceDialogsListItem.js';import {useGetChannelsByUserWithServiceChannelsQuery,OnChatMessageAddedDocument}from'common/graphql';import {RoomType}from'common';import {userSelector}from'@adminide-stack/user-auth0-client';import {config}from'../config/config.js';import colors from'tailwindcss/colors';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -17,231 +17,6 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- const Actions = {
21
- INITIAL_CONTEXT: "INITIAL_CONTEXT",
22
- ERROR_HANDLED: "ERROR_HANDLED",
23
- FETCH_CHANNELS: "FETCH_CHANNELS",
24
- APPEND_CHANNELS: "APPEND_CHANNELS",
25
- REFRESH_CHANNELS: "REFRESH_CHANNELS",
26
- SELECT_CHANNEL: "SELECT_CHANNEL",
27
- START_LOADING: "START_LOADING",
28
- STOP_LOADING: "STOP_LOADING",
29
- LOAD_MORE_CHANNELS: "LOAD_MORE_CHANNELS",
30
- SET_SEARCH_QUERY: "SET_SEARCH_QUERY",
31
- UPDATE_CHANNEL: "UPDATE_CHANNEL",
32
- REORDER_CHANNELS: "REORDER_CHANNELS"
33
- };
34
- const BaseState = {
35
- Idle: "idle",
36
- Error: "error",
37
- Loading: "loading",
38
- Done: "done",
39
- FetchChannels: "fetchChannels"
40
- };
41
- const MainState = {
42
- RefreshChannels: "refreshChannels",
43
- SelectChannel: "selectChannel",
44
- LoadMoreChannels: "loadMoreChannels"
45
- };
46
- function useSafeMachine(machine) {
47
- const [state, setState] = useState({
48
- context: {
49
- channels: [],
50
- refreshing: false,
51
- loading: false,
52
- error: null,
53
- searchQuery: "",
54
- selectedChannelId: null,
55
- channelRole: null,
56
- channelFilters: {},
57
- supportServices: false,
58
- page: 1,
59
- hasMoreChannels: true,
60
- loadingMore: false
61
- },
62
- value: "idle"
63
- });
64
- const send = useCallback((event) => {
65
- var _a, _b, _c, _d, _e, _f;
66
- try {
67
- console.log("Event received:", event.type);
68
- if (event.type === Actions.INITIAL_CONTEXT) {
69
- setState((prev) => {
70
- var _a2, _b2, _c2, _d2;
71
- return __spreadProps(__spreadValues({}, prev), {
72
- context: __spreadProps(__spreadValues({}, prev.context), {
73
- channelRole: ((_a2 = event.data) == null ? void 0 : _a2.channelRole) || null,
74
- channelFilters: ((_b2 = event.data) == null ? void 0 : _b2.channelFilters) || {},
75
- supportServices: ((_c2 = event.data) == null ? void 0 : _c2.supportServices) || false,
76
- selectedChannelId: ((_d2 = event.data) == null ? void 0 : _d2.selectedChannelId) || null,
77
- loading: true,
78
- page: 1,
79
- hasMoreChannels: true
80
- }),
81
- value: BaseState.FetchChannels
82
- });
83
- });
84
- } else if (event.type === Actions.FETCH_CHANNELS) {
85
- console.log("Setting channels:", ((_b = (_a = event.data) == null ? void 0 : _a.channels) == null ? void 0 : _b.length) || 0);
86
- const processedChannels = ((_d = (_c = event.data) == null ? void 0 : _c.channels) == null ? void 0 : _d.map((channel) => {
87
- if (channel.lastMessage) {
88
- return __spreadProps(__spreadValues({}, channel), {
89
- lastMessage: __spreadProps(__spreadValues({}, channel.lastMessage), {
90
- id: channel.lastMessage.id,
91
- message: channel.lastMessage.message,
92
- createdAt: channel.lastMessage.createdAt || channel.lastMessage.updatedAt,
93
- updatedAt: channel.lastMessage.updatedAt || channel.lastMessage.createdAt,
94
- userId: channel.lastMessage.userId,
95
- channelId: channel.lastMessage.channelId || channel.id
96
- })
97
- });
98
- }
99
- return channel;
100
- })) || [];
101
- setState((prev) => {
102
- var _a2, _b2, _c2, _d2;
103
- return __spreadProps(__spreadValues({}, prev), {
104
- context: __spreadProps(__spreadValues({}, prev.context), {
105
- channels: processedChannels,
106
- hasMoreChannels: (((_b2 = (_a2 = event.data) == null ? void 0 : _a2.channels) == null ? void 0 : _b2.length) || 0) > 0,
107
- loading: ((_c2 = event.data) == null ? void 0 : _c2.stopLoading) ? false : prev.context.loading,
108
- refreshing: ((_d2 = event.data) == null ? void 0 : _d2.stopLoading) ? false : prev.context.refreshing,
109
- loadingMore: false
110
- }),
111
- value: BaseState.Idle
112
- });
113
- });
114
- } else if (event.type === Actions.APPEND_CHANNELS) {
115
- const newChannels = ((_e = event.data) == null ? void 0 : _e.channels) || [];
116
- console.log("Appending channels:", newChannels.length);
117
- const processedNewChannels = newChannels.map((channel) => {
118
- if (channel.lastMessage) {
119
- return __spreadProps(__spreadValues({}, channel), {
120
- lastMessage: __spreadProps(__spreadValues({}, channel.lastMessage), {
121
- id: channel.lastMessage.id,
122
- message: channel.lastMessage.message,
123
- createdAt: channel.lastMessage.createdAt || channel.lastMessage.updatedAt,
124
- updatedAt: channel.lastMessage.updatedAt || channel.lastMessage.createdAt,
125
- userId: channel.lastMessage.userId,
126
- channelId: channel.lastMessage.channelId || channel.id
127
- })
128
- });
129
- }
130
- return channel;
131
- });
132
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
133
- context: __spreadProps(__spreadValues({}, prev.context), {
134
- channels: [...prev.context.channels, ...processedNewChannels],
135
- hasMoreChannels: newChannels.length >= 10,
136
- page: prev.context.page + 1,
137
- loadingMore: false
138
- }),
139
- value: BaseState.Idle
140
- }));
141
- } else if (event.type === Actions.UPDATE_CHANNEL) {
142
- setState((prev) => {
143
- var _a2;
144
- const updatedChannel = (_a2 = event.data) == null ? void 0 : _a2.channel;
145
- if (!updatedChannel || !updatedChannel.id)
146
- return prev;
147
- const updatedChannels = prev.context.channels.map((channel) => channel.id === updatedChannel.id ? updatedChannel : channel);
148
- return __spreadProps(__spreadValues({}, prev), {
149
- context: __spreadProps(__spreadValues({}, prev.context), {
150
- channels: updatedChannels
151
- })
152
- });
153
- });
154
- } else if (event.type === Actions.REORDER_CHANNELS) {
155
- setState((prev) => {
156
- const sortedChannels = [...prev.context.channels].sort((a, b) => {
157
- const dateA = new Date((a == null ? void 0 : a.updatedAt) || (a == null ? void 0 : a.createdAt)).getTime();
158
- const dateB = new Date((b == null ? void 0 : b.updatedAt) || (b == null ? void 0 : b.createdAt)).getTime();
159
- return dateB - dateA;
160
- });
161
- return __spreadProps(__spreadValues({}, prev), {
162
- context: __spreadProps(__spreadValues({}, prev.context), {
163
- channels: sortedChannels
164
- })
165
- });
166
- });
167
- } else if (event.type === Actions.REFRESH_CHANNELS) {
168
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
169
- context: __spreadProps(__spreadValues({}, prev.context), {
170
- refreshing: true,
171
- page: 1,
172
- hasMoreChannels: true
173
- }),
174
- value: MainState.RefreshChannels
175
- }));
176
- } else if (event.type === Actions.SELECT_CHANNEL) {
177
- setState((prev) => {
178
- var _a2;
179
- return __spreadProps(__spreadValues({}, prev), {
180
- context: __spreadProps(__spreadValues({}, prev.context), {
181
- selectedChannelId: ((_a2 = event.data) == null ? void 0 : _a2.channelId) || null
182
- })
183
- });
184
- });
185
- } else if (event.type === Actions.START_LOADING) {
186
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
187
- context: __spreadProps(__spreadValues({}, prev.context), {
188
- loading: true
189
- })
190
- }));
191
- } else if (event.type === Actions.STOP_LOADING) {
192
- console.log("Explicitly stopping loading state");
193
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
194
- context: __spreadProps(__spreadValues({}, prev.context), {
195
- loading: false,
196
- refreshing: false,
197
- loadingMore: false
198
- }),
199
- value: prev.value === BaseState.FetchChannels ? BaseState.Idle : prev.value
200
- }));
201
- } else if (event.type === Actions.LOAD_MORE_CHANNELS) {
202
- setState((prev) => __spreadProps(__spreadValues({}, prev), {
203
- context: __spreadProps(__spreadValues({}, prev.context), {
204
- loadingMore: true
205
- }),
206
- value: MainState.LoadMoreChannels
207
- }));
208
- } else if (event.type === Actions.SET_SEARCH_QUERY) {
209
- setState((prev) => {
210
- var _a2;
211
- return __spreadProps(__spreadValues({}, prev), {
212
- context: __spreadProps(__spreadValues({}, prev.context), {
213
- searchQuery: ((_a2 = event.data) == null ? void 0 : _a2.searchQuery) || ""
214
- })
215
- });
216
- });
217
- } else if (event.type === Actions.ERROR_HANDLED) {
218
- console.log("Error handled:", (_f = event.data) == null ? void 0 : _f.message);
219
- setState((prev) => {
220
- var _a2;
221
- return __spreadProps(__spreadValues({}, prev), {
222
- context: __spreadProps(__spreadValues({}, prev.context), {
223
- error: ((_a2 = event.data) == null ? void 0 : _a2.message) || null,
224
- loading: false,
225
- refreshing: false,
226
- loadingMore: false
227
- }),
228
- value: BaseState.Idle
229
- });
230
- });
231
- }
232
- } catch (error) {
233
- console.error("Error handling event:", error);
234
- }
235
- }, []);
236
- const stateWithMatches = useMemo(() => {
237
- return __spreadProps(__spreadValues({}, state), {
238
- matches: (checkState) => {
239
- return state.value === checkState;
240
- }
241
- });
242
- }, [state]);
243
- return [stateWithMatches, send];
244
- }
245
20
  const DialogsComponent = (props) => {
246
21
  var _a;
247
22
  const {
@@ -256,79 +31,22 @@ const DialogsComponent = (props) => {
256
31
  } = useRoute();
257
32
  const auth = useSelector(userSelector);
258
33
  const navigation = useNavigation();
34
+ const [searchQuery, setSearchQuery] = useState("");
35
+ const [selectedChannelId, setSelectedChannelId] = useState((params == null ? void 0 : params.channelId) || null);
36
+ const [page, setPage] = useState(1);
37
+ const [isLoadingMore, setIsLoadingMore] = useState(false);
259
38
  const isMountedRef = useRef(true);
260
- const [state, send] = useSafeMachine();
261
- useCallback(() => {
262
- try {
263
- return (state == null ? void 0 : state.context) || {};
264
- } catch (error) {
265
- console.error("Error accessing state.context:", error);
266
- return {};
267
- }
268
- }, [state]);
269
- const safeContextProperty = useCallback((property, defaultValue = null) => {
270
- var _a2, _b;
271
- try {
272
- return (_b = (_a2 = state == null ? void 0 : state.context) == null ? void 0 : _a2[property]) != null ? _b : defaultValue;
273
- } catch (error) {
274
- console.error(`Error accessing state.context.${property}:`, error);
275
- return defaultValue;
276
- }
277
- }, [state]);
278
- const safeMatches = useCallback((stateValue) => {
279
- var _a2;
280
- try {
281
- return ((_a2 = state == null ? void 0 : state.matches) == null ? void 0 : _a2.call(state, stateValue)) || false;
282
- } catch (error) {
283
- console.error(`Error calling state.matches with ${stateValue}:`, error);
284
- return false;
285
- }
286
- }, [state]);
287
- const safeSend = useCallback((event) => {
288
- try {
289
- send(event);
290
- } catch (error) {
291
- console.error("Error sending event to state machine:", error, event);
292
- }
293
- }, [send]);
294
- const channels = safeContextProperty("channels", []);
295
- const refreshing = safeContextProperty("refreshing", false);
296
- const loading = safeContextProperty("loading", false);
297
- const searchQuery = safeContextProperty("searchQuery", "");
298
- const selectedChannelId = safeContextProperty("selectedChannelId", null);
299
- const loadingMore = safeContextProperty("loadingMore", false);
300
- const hasMoreChannels = safeContextProperty("hasMoreChannels", true);
301
- const page = safeContextProperty("page", 1);
302
- const stateRef = useRef(state);
303
- useEffect(() => {
304
- stateRef.current = state;
305
- }, [state]);
306
- const safeGetContext = useCallback(() => {
307
- if (stateRef.current && stateRef.current.context) {
308
- return stateRef.current.context;
309
- }
310
- return {
311
- channels: [],
312
- refreshing: false,
313
- loading: false,
314
- error: null,
315
- searchQuery: "",
316
- selectedChannelId: null,
317
- channelRole: null,
318
- channelFilters: {},
319
- supportServices: false,
320
- page: 1,
321
- hasMoreChannels: true,
322
- loadingMore: false
323
- };
324
- }, []);
325
- useEffect(() => {
326
- return () => {
327
- isMountedRef.current = false;
328
- };
329
- }, []);
39
+ const focusRefreshRef = useRef(null);
40
+ const lastRefreshTimeRef = useRef(Date.now());
41
+ const MIN_REFRESH_INTERVAL = 2e3;
42
+ const lastNavigationTimestamp = useRef(0);
43
+ const activeChannelRef = useRef(null);
44
+ const resetActiveChannelTimeoutRef = useRef(null);
330
45
  const {
331
- refetch: getChannelsRefetch,
46
+ data,
47
+ loading,
48
+ refetch,
49
+ fetchMore,
332
50
  subscribeToMore
333
51
  } = useGetChannelsByUserWithServiceChannelsQuery({
334
52
  variables: {
@@ -343,143 +61,50 @@ const DialogsComponent = (props) => {
343
61
  },
344
62
  fetchPolicy: "cache-and-network",
345
63
  nextFetchPolicy: "network-only",
346
- notifyOnNetworkStatusChange: true,
347
- skip: true
64
+ notifyOnNetworkStatusChange: true
348
65
  });
349
- const fetchChannelsDirectly = useCallback(async (pageNum = 1, append = false) => {
350
- var _a2, _b, _c;
351
- try {
352
- const context = safeGetContext();
353
- console.log(`\u{1F4AB} FETCHING channels (page: ${pageNum}, append: ${append})`);
354
- const skipCount = (pageNum - 1) * 15;
355
- const fetchPromise = getChannelsRefetch({
356
- role: channelRole,
357
- criteria: channelFilters,
358
- supportServices: supportServices ? true : false,
359
- supportServiceCriteria: {
360
- type: RoomType.Service
361
- },
362
- limit: 15,
363
- skip: skipCount
364
- });
365
- const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error("Request timeout")), 8e3));
366
- const result = await Promise.race([fetchPromise, timeoutPromise]);
367
- const data = (result == null ? void 0 : result.data) || {};
368
- const allChannels = [...(_a2 = data == null ? void 0 : data.supportServiceChannels) != null ? _a2 : [], ...(_b = data == null ? void 0 : data.channelsByUser) != null ? _b : []];
369
- const filteredChannels = (_c = allChannels == null ? void 0 : allChannels.filter((c) => {
370
- if (!c || !c.members)
371
- return false;
372
- for (const member of c.members) {
373
- if (member && member.user && member.user.id !== (auth == null ? void 0 : auth.id) && member.user.__typename === "UserAccount") {
374
- return true;
375
- }
376
- }
66
+ const processChannels = useCallback((rawChannels = []) => {
67
+ if (!rawChannels || !rawChannels.length)
68
+ return [];
69
+ const filteredChannels2 = rawChannels.filter((c) => {
70
+ if (!c || !c.members)
377
71
  return false;
378
- })) != null ? _c : [];
379
- const sortedChannels = filteredChannels.sort((a, b) => {
380
- const dateA = new Date(a.updatedAt || a.createdAt);
381
- const dateB = new Date(b.updatedAt || b.createdAt);
382
- return dateB.getTime() - dateA.getTime();
383
- }) || [];
384
- console.log(`\u{1F4CA} Processed channels: ${sortedChannels.length} (page: ${pageNum}, skip: ${skipCount})`);
385
- if (isMountedRef.current) {
386
- if (append) {
387
- safeSend({
388
- type: Actions.APPEND_CHANNELS,
389
- data: {
390
- channels: sortedChannels
391
- }
392
- });
393
- } else {
394
- safeSend({
395
- type: Actions.FETCH_CHANNELS,
396
- data: {
397
- channels: sortedChannels,
398
- stopLoading: true
399
- }
400
- });
72
+ for (const member of c.members) {
73
+ if (member && member.user && member.user.id !== (auth == null ? void 0 : auth.id) && member.user.__typename === "UserAccount") {
74
+ return true;
401
75
  }
402
76
  }
403
- } catch (error) {
404
- console.error("Error fetching channels:", error);
405
- if (isMountedRef.current) {
406
- safeSend({
407
- type: Actions.ERROR_HANDLED,
408
- data: {
409
- message: "Failed to fetch channels"
410
- }
411
- });
412
- }
413
- }
414
- }, [getChannelsRefetch, channelRole, channelFilters, supportServices, auth == null ? void 0 : auth.id, safeSend]);
415
- useEffect(() => {
416
- if (loading) {
417
- const safetyTimeout = setTimeout(() => {
418
- console.log("\u26A0\uFE0F Safety timeout triggered - forcing loading state to stop");
419
- if (isMountedRef.current) {
420
- safeSend({
421
- type: Actions.STOP_LOADING
422
- });
423
- }
424
- }, 3e3);
425
- return () => clearTimeout(safetyTimeout);
426
- }
427
- }, [loading, safeSend]);
428
- const fastRefresh = useCallback(async () => {
429
- var _a2, _b, _c;
430
- try {
431
- console.log("\u{1F504} Fast refreshing channels...");
432
- const clearRefreshingTimeout = setTimeout(() => {
433
- if (isMountedRef.current) {
434
- console.log("\u26A0\uFE0F Fast refresh timeout - stopping refresh state");
435
- safeSend({
436
- type: Actions.STOP_LOADING
437
- });
438
- }
439
- }, 3e3);
440
- const {
441
- data
442
- } = await getChannelsRefetch({
443
- role: channelRole,
444
- criteria: channelFilters,
445
- supportServices: supportServices ? true : false,
446
- supportServiceCriteria: {
447
- type: RoomType.Service
448
- },
449
- limit: 10,
450
- skip: 0
451
- });
452
- clearTimeout(clearRefreshingTimeout);
453
- if (!isMountedRef.current)
454
- return;
455
- const allChannels = [...(_a2 = data == null ? void 0 : data.supportServiceChannels) != null ? _a2 : [], ...(_b = data == null ? void 0 : data.channelsByUser) != null ? _b : []];
456
- const filteredChannels = (_c = allChannels == null ? void 0 : allChannels.filter((c) => c.members.some((u) => {
457
- var _a3;
458
- return u !== null && ((_a3 = u == null ? void 0 : u.user) == null ? void 0 : _a3.id) != (auth == null ? void 0 : auth.id) && u.user.__typename == "UserAccount";
459
- }))) != null ? _c : [];
460
- const sortedChannels = filteredChannels && orderBy(filteredChannels, ["updatedAt"], ["desc"]) || [];
461
- console.log(`\u{1F4CA} Fast refresh completed: ${sortedChannels.length} channels`);
462
- if (isMountedRef.current) {
463
- safeSend({
464
- type: Actions.FETCH_CHANNELS,
465
- data: {
466
- channels: sortedChannels,
467
- stopLoading: true
468
- }
469
- });
470
- }
471
- } catch (error) {
472
- console.error("Error during fast refresh:", error);
473
- if (isMountedRef.current) {
474
- safeSend({
475
- type: Actions.STOP_LOADING
77
+ return false;
78
+ });
79
+ return filteredChannels2.map((channel) => {
80
+ if (channel.lastMessage) {
81
+ return __spreadProps(__spreadValues({}, channel), {
82
+ lastMessage: __spreadProps(__spreadValues({}, channel.lastMessage), {
83
+ id: channel.lastMessage.id,
84
+ message: channel.lastMessage.message,
85
+ createdAt: channel.lastMessage.createdAt || channel.lastMessage.updatedAt,
86
+ updatedAt: channel.lastMessage.updatedAt || channel.lastMessage.createdAt,
87
+ userId: channel.lastMessage.userId,
88
+ channelId: channel.lastMessage.channelId || channel.id
89
+ })
476
90
  });
477
91
  }
478
- }
479
- }, [getChannelsRefetch, channelRole, channelFilters, supportServices, auth == null ? void 0 : auth.id, safeSend]);
480
- const messageSubscriptionRef = useRef(null);
92
+ return channel;
93
+ });
94
+ }, [auth == null ? void 0 : auth.id]);
95
+ const sortChannels = useCallback((channels2) => {
96
+ if (!channels2 || !channels2.length)
97
+ return [];
98
+ return [...channels2].sort((a, b) => {
99
+ const dateA = new Date((a == null ? void 0 : a.updatedAt) || (a == null ? void 0 : a.createdAt)).getTime();
100
+ const dateB = new Date((b == null ? void 0 : b.updatedAt) || (b == null ? void 0 : b.createdAt)).getTime();
101
+ return dateB - dateA;
102
+ });
103
+ }, []);
104
+ const allChannels = [...(data == null ? void 0 : data.supportServiceChannels) || [], ...(data == null ? void 0 : data.channelsByUser) || []];
105
+ const channels = sortChannels(processChannels(allChannels));
481
106
  useEffect(() => {
482
- if (!auth || !auth.id || messageSubscriptionRef.current)
107
+ if (!auth || !auth.id)
483
108
  return;
484
109
  console.log("\u{1F4F1} Setting up global message subscription for dialog updates");
485
110
  const unsubscribe = subscribeToMore({
@@ -488,6 +113,7 @@ const DialogsComponent = (props) => {
488
113
  updateQuery: (prev, {
489
114
  subscriptionData
490
115
  }) => {
116
+ var _a2, _b;
491
117
  try {
492
118
  if (!subscriptionData.data || !isMountedRef.current)
493
119
  return prev;
@@ -496,114 +122,63 @@ const DialogsComponent = (props) => {
496
122
  console.log("\u{1F4F1} Dialog subscription received message update:", newMessage == null ? void 0 : newMessage.id);
497
123
  if (!newMessage || !newMessage.channelId)
498
124
  return prev;
499
- const currentChannels = safeGetContext().channels || [];
500
- const channelToUpdate = currentChannels.find((c) => {
501
- var _a2, _b;
502
- return ((_a2 = c.id) == null ? void 0 : _a2.toString()) === ((_b = newMessage.channelId) == null ? void 0 : _b.toString());
125
+ const channelId = newMessage.channelId.toString();
126
+ let foundInDirectChannels = false;
127
+ let foundInServiceChannels = false;
128
+ const directChannelIndex = (_a2 = prev.channelsByUser) == null ? void 0 : _a2.findIndex((c) => c.id.toString() === channelId);
129
+ if (directChannelIndex !== void 0 && directChannelIndex >= 0) {
130
+ foundInDirectChannels = true;
131
+ }
132
+ const serviceChannelIndex = (_b = prev.supportServiceChannels) == null ? void 0 : _b.findIndex((c) => c.id.toString() === channelId);
133
+ if (serviceChannelIndex !== void 0 && serviceChannelIndex >= 0) {
134
+ foundInServiceChannels = true;
135
+ }
136
+ const result = __spreadProps(__spreadValues({}, prev), {
137
+ channelsByUser: [...prev.channelsByUser || []],
138
+ supportServiceChannels: [...prev.supportServiceChannels || []]
503
139
  });
504
- if (channelToUpdate) {
505
- console.log("\u{1F4F1} Found channel to update:", channelToUpdate.id);
506
- const updatedChannel = __spreadProps(__spreadValues({}, channelToUpdate), {
507
- updatedAt: newMessage.createdAt || newMessage.updatedAt,
508
- lastMessage: __spreadProps(__spreadValues({}, newMessage), {
509
- id: newMessage.id,
510
- message: newMessage.message,
511
- createdAt: newMessage.createdAt || newMessage.updatedAt,
512
- updatedAt: newMessage.updatedAt || newMessage.createdAt,
513
- userId: newMessage.userId,
514
- channelId: newMessage.channelId
515
- })
516
- });
517
- if (isMountedRef.current) {
518
- safeSend({
519
- type: Actions.UPDATE_CHANNEL,
520
- data: {
521
- channel: updatedChannel
522
- }
523
- });
524
- safeSend({
525
- type: Actions.REORDER_CHANNELS
526
- });
527
- }
528
- } else {
529
- console.log("\u{1F4F1} Channel not found in current list, triggering refresh");
530
- if (isMountedRef.current && !safeGetContext().refreshing && !safeGetContext().loading) {
531
- fastRefresh();
532
- }
140
+ if (foundInDirectChannels && directChannelIndex >= 0) {
141
+ const channel = __spreadValues({}, result.channelsByUser[directChannelIndex]);
142
+ channel.lastMessage = newMessage;
143
+ channel.updatedAt = newMessage.createdAt || new Date().toISOString();
144
+ result.channelsByUser[directChannelIndex] = channel;
533
145
  }
534
- return prev;
146
+ if (foundInServiceChannels && serviceChannelIndex >= 0) {
147
+ const channel = __spreadValues({}, result.supportServiceChannels[serviceChannelIndex]);
148
+ channel.lastMessage = newMessage;
149
+ channel.updatedAt = newMessage.createdAt || new Date().toISOString();
150
+ result.supportServiceChannels[serviceChannelIndex] = channel;
151
+ }
152
+ return result;
535
153
  } catch (error) {
536
154
  console.error("Error in dialog subscription handler:", error);
537
155
  return prev;
538
156
  }
539
157
  }
540
158
  });
541
- messageSubscriptionRef.current = unsubscribe;
542
159
  return () => {
543
- if (messageSubscriptionRef.current) {
544
- console.log("\u{1F4F1} Cleaning up dialog message subscription");
545
- messageSubscriptionRef.current();
546
- messageSubscriptionRef.current = null;
547
- }
160
+ console.log("\u{1F4F1} Cleaning up dialog message subscription");
161
+ unsubscribe();
548
162
  };
549
- }, [auth == null ? void 0 : auth.id, isMountedRef, safeGetContext, fastRefresh, safeSend, subscribeToMore]);
163
+ }, [auth == null ? void 0 : auth.id, subscribeToMore]);
550
164
  useEffect(() => {
551
- const context = safeGetContext();
552
- const isAlreadyFetching = context.refreshing || context.loading;
553
- if (!isAlreadyFetching) {
554
- if (safeMatches(BaseState.FetchChannels)) {
555
- console.log("\u{1F504} Fetching channels...");
556
- fetchChannelsDirectly(1, false);
557
- } else if (safeMatches(MainState.RefreshChannels)) {
558
- console.log("\u{1F504} Refreshing channels...");
559
- fetchChannelsDirectly(1, false);
560
- } else if (safeMatches(MainState.LoadMoreChannels)) {
561
- console.log("\u{1F504} Loading more channels...");
562
- fetchChannelsDirectly(page, true);
165
+ return () => {
166
+ isMountedRef.current = false;
167
+ if (resetActiveChannelTimeoutRef.current) {
168
+ clearTimeout(resetActiveChannelTimeoutRef.current);
563
169
  }
564
- } else {
565
- console.log("\u23E9 Skipping fetch because isAlreadyFetching:", isAlreadyFetching);
566
- }
567
- }, [fetchChannelsDirectly, safeMatches, safeGetContext, state.value, page]);
568
- useEffect(() => {
569
- console.log("State changed to:", state.value);
570
- console.log("Context:", JSON.stringify({
571
- channelsCount: channels.length,
572
- loading,
573
- refreshing
574
- }));
575
- }, [state.value, channels.length, loading, refreshing]);
576
- useEffect(() => {
577
- if (isMountedRef.current) {
578
- console.log("\u{1F680} Initializing state machine with props", {
579
- channelRole,
580
- channelFilters,
581
- supportServices,
582
- selectedChannelId: params == null ? void 0 : params.channelId
583
- });
584
- safeSend({
585
- type: Actions.INITIAL_CONTEXT,
586
- data: {
587
- channelRole,
588
- channelFilters,
589
- supportServices,
590
- selectedChannelId: params == null ? void 0 : params.channelId
591
- }
592
- });
593
- const initSafetyTimeout = setTimeout(() => {
594
- if (isMountedRef.current && loading) {
595
- console.log("\u26A0\uFE0F Init safety timeout triggered - forcing loading state to stop");
596
- safeSend({
597
- type: Actions.STOP_LOADING
598
- });
599
- }
600
- }, 8e3);
601
- return () => clearTimeout(initSafetyTimeout);
602
- }
170
+ };
603
171
  }, []);
604
- const focusRefreshRef = useRef(null);
605
- const lastRefreshTimeRef = useRef(Date.now());
606
- const MIN_REFRESH_INTERVAL = 2e3;
172
+ useFocusEffect(useCallback(() => {
173
+ const now = Date.now();
174
+ if (now - lastNavigationTimestamp.current > 300) {
175
+ activeChannelRef.current = null;
176
+ console.log("Reset active channel reference on focus");
177
+ }
178
+ return () => {
179
+ lastNavigationTimestamp.current = Date.now();
180
+ };
181
+ }, []));
607
182
  useFocusEffect(useCallback(() => {
608
183
  console.log("\u{1F4F1} Focus effect triggered for Dialogs screen");
609
184
  const performRefresh = () => {
@@ -612,30 +187,63 @@ const DialogsComponent = (props) => {
612
187
  console.log("\u23E9 Skipping refresh: too soon after previous refresh");
613
188
  return;
614
189
  }
615
- console.log("\u{1F504} Performing forced refresh on screen focus");
190
+ console.log("\u{1F504} Performing refresh on screen focus");
616
191
  if (isMountedRef.current) {
617
192
  lastRefreshTimeRef.current = now;
618
- safeSend({
619
- type: Actions.START_LOADING,
620
- data: {
621
- refreshing: true
622
- }
623
- });
624
- fastRefresh();
193
+ refetch();
625
194
  }
626
195
  };
627
196
  const focusRefreshTimeout = setTimeout(performRefresh, 100);
628
- return () => {
629
- clearTimeout(focusRefreshTimeout);
630
- };
631
- }, [safeSend, fastRefresh]));
632
- const handleSelectChannel = useCallback((id, title) => {
633
- safeSend({
634
- type: Actions.SELECT_CHANNEL,
635
- data: {
636
- channelId: id
197
+ return () => clearTimeout(focusRefreshTimeout);
198
+ }, [refetch]));
199
+ const handlePullToRefresh = useCallback(() => {
200
+ const now = Date.now();
201
+ focusRefreshRef.current = now;
202
+ console.log("\u{1F504} Pull-to-refresh triggered");
203
+ refetch();
204
+ }, [refetch]);
205
+ const handleLoadMore = useCallback(() => {
206
+ if (isLoadingMore || !data || channels.length < 10) {
207
+ console.log("Skip loading more: already loading or all data loaded");
208
+ return;
209
+ }
210
+ console.log("Loading more channels at page:", page + 1);
211
+ setIsLoadingMore(true);
212
+ fetchMore({
213
+ variables: {
214
+ skip: page * 15
215
+ },
216
+ updateQuery: (prev, {
217
+ fetchMoreResult
218
+ }) => {
219
+ setIsLoadingMore(false);
220
+ setPage((prevPage) => prevPage + 1);
221
+ if (!fetchMoreResult)
222
+ return prev;
223
+ return __spreadProps(__spreadValues({}, fetchMoreResult), {
224
+ channelsByUser: [...prev.channelsByUser || [], ...fetchMoreResult.channelsByUser || []],
225
+ supportServiceChannels: [...prev.supportServiceChannels || [], ...fetchMoreResult.supportServiceChannels || []]
226
+ });
637
227
  }
228
+ }).catch((error) => {
229
+ console.error("Error loading more channels:", error);
230
+ setIsLoadingMore(false);
638
231
  });
232
+ }, [fetchMore, isLoadingMore, data, channels.length, page]);
233
+ const handleSelectChannel = useCallback((id, title) => {
234
+ if (activeChannelRef.current === id) {
235
+ console.log("\u{1F4F1} Ignoring repeated tap on channel:", id);
236
+ return;
237
+ }
238
+ activeChannelRef.current = id;
239
+ if (resetActiveChannelTimeoutRef.current) {
240
+ clearTimeout(resetActiveChannelTimeoutRef.current);
241
+ }
242
+ resetActiveChannelTimeoutRef.current = setTimeout(() => {
243
+ activeChannelRef.current = null;
244
+ }, 2e3);
245
+ setSelectedChannelId(id);
246
+ console.log("\u{1F4F1} Navigating to channel:", id);
639
247
  navigation.navigate(config.INBOX_MESSEGE_PATH, {
640
248
  channelId: id,
641
249
  role: channelRole,
@@ -643,14 +251,21 @@ const DialogsComponent = (props) => {
643
251
  hideTabBar: true,
644
252
  timestamp: new Date().getTime()
645
253
  });
646
- }, [navigation, channelRole, safeSend]);
254
+ }, [navigation, channelRole]);
647
255
  const handleSelectServiceChannel = useCallback((id, title, postParentId) => {
648
- safeSend({
649
- type: Actions.SELECT_CHANNEL,
650
- data: {
651
- channelId: id
652
- }
653
- });
256
+ if (activeChannelRef.current === id) {
257
+ console.log("\u{1F4F1} Ignoring repeated tap on service channel:", id);
258
+ return;
259
+ }
260
+ activeChannelRef.current = id;
261
+ if (resetActiveChannelTimeoutRef.current) {
262
+ clearTimeout(resetActiveChannelTimeoutRef.current);
263
+ }
264
+ resetActiveChannelTimeoutRef.current = setTimeout(() => {
265
+ activeChannelRef.current = null;
266
+ }, 2e3);
267
+ setSelectedChannelId(id);
268
+ console.log("\u{1F4F1} Navigating to service channel:", id);
654
269
  navigation.navigate(postParentId || postParentId === 0 ? config.THREAD_MESSEGE_PATH : config.THREADS_PATH, {
655
270
  channelId: id,
656
271
  role: channelRole,
@@ -658,92 +273,61 @@ const DialogsComponent = (props) => {
658
273
  postParentId,
659
274
  hideTabBar: true
660
275
  });
661
- }, [navigation, channelRole, safeSend]);
662
- const handlePullToRefresh = useCallback(() => {
663
- if (refreshing) {
664
- console.log("\u23E9 Skipping refresh because already refreshing");
665
- return;
666
- }
667
- const now = Date.now();
668
- focusRefreshRef.current = now;
669
- console.log("\u{1F504} Pull-to-refresh triggered");
670
- safeSend({
671
- type: Actions.START_LOADING,
672
- data: {
673
- refreshing: true
674
- }
675
- });
676
- fastRefresh();
677
- }, [safeSend, refreshing, fastRefresh]);
276
+ }, [navigation, channelRole]);
678
277
  const handleSearchChange = useCallback((text) => {
679
- safeSend({
680
- type: Actions.SET_SEARCH_QUERY,
681
- data: {
682
- searchQuery: text
278
+ setSearchQuery(text);
279
+ }, []);
280
+ const filteredChannels = useCallback(() => {
281
+ if (!searchQuery.trim())
282
+ return channels;
283
+ const query = searchQuery.toLowerCase();
284
+ return channels.filter((channel) => {
285
+ if (channel.title && channel.title.toLowerCase().includes(query)) {
286
+ return true;
683
287
  }
684
- });
685
- }, [safeSend]);
686
- const handleLoadMore = useCallback(() => {
687
- if (!loadingMore && hasMoreChannels) {
688
- console.log("Loading more channels at page:", page + 1);
689
- safeSend({
690
- type: Actions.LOAD_MORE_CHANNELS
691
- });
692
- } else {
693
- console.log("Skip loading more: loadingMore=", loadingMore, "hasMoreChannels=", hasMoreChannels);
694
- }
695
- }, [safeSend, loadingMore, hasMoreChannels, page]);
696
- return /* @__PURE__ */ React__default.createElement(Box, { className: "p-2" }, /* @__PURE__ */ React__default.createElement(
697
- FlatList,
698
- {
699
- data: channels,
700
- onRefresh: handlePullToRefresh,
701
- refreshing,
702
- contentContainerStyle: {
703
- minHeight: "100%"
704
- },
705
- ItemSeparatorComponent: () => /* @__PURE__ */ React__default.createElement(Box, { className: "h-0.5 bg-gray-200" }),
706
- renderItem: ({
707
- item: channel
708
- }) => {
709
- const key = `${channel.type === RoomType.Service ? "service" : "direct"}-${channel.id}`;
710
- return (channel == null ? void 0 : channel.type) === RoomType.Service ? /* @__PURE__ */ React__default.createElement(ServiceDialogsListItem, { key, onOpen: handleSelectServiceChannel, currentUser: auth, channel, refreshing, selectedChannelId, role: channelRole }) : /* @__PURE__ */ React__default.createElement(DialogsListItem, { key, onOpen: handleSelectChannel, currentUser: auth, channel, selectedChannelId, forceRefresh: true });
711
- },
712
- ListFooterComponent: () => loadingMore ? /* @__PURE__ */ React__default.createElement(Center, { className: "py-4" }, /* @__PURE__ */ React__default.createElement(Spinner, { color: colors.blue[500], size: "small" })) : null,
713
- onEndReached: handleLoadMore,
714
- onEndReachedThreshold: 0.5,
715
- initialNumToRender: 5,
716
- maxToRenderPerBatch: 5,
717
- windowSize: 5,
718
- removeClippedSubviews: true,
719
- updateCellsBatchingPeriod: 100,
720
- getItemLayout: (data, index) => ({
721
- length: 80,
722
- offset: 80 * index,
723
- index
724
- }),
725
- keyExtractor: (item) => `channel-${item.id}`,
726
- ListEmptyComponent: () => {
727
- console.log("Rendering ListEmptyComponent", {
728
- loading,
729
- refreshing,
730
- stateValue: state.value
731
- });
732
- if (loading && channels.length === 0) {
733
- return /* @__PURE__ */ React__default.createElement(Center, { className: "flex-1 justify-center items-center", style: {
734
- height: 300
735
- } }, /* @__PURE__ */ React__default.createElement(Spinner, { color: colors.blue[500], size: "large" }), /* @__PURE__ */ React__default.createElement(Text, { className: "mt-4 text-gray-500" }, "Loading conversations..."));
288
+ if (channel.members) {
289
+ for (const member of channel.members) {
290
+ const user = member == null ? void 0 : member.user;
291
+ if (!user)
292
+ continue;
293
+ const fullName = `${user.givenName || ""} ${user.familyName || ""}`.toLowerCase();
294
+ if (fullName.includes(query)) {
295
+ return true;
296
+ }
297
+ if (user.username && user.username.toLowerCase().includes(query)) {
298
+ return true;
299
+ }
736
300
  }
737
- return /* @__PURE__ */ React__default.createElement(Box, { className: "p-6" }, /* @__PURE__ */ React__default.createElement(Box, { className: "mb-6" }, /* @__PURE__ */ React__default.createElement(Heading, { className: "text-2xl font-bold" }, "Direct Messages"), /* @__PURE__ */ React__default.createElement(Text, { className: "text-gray-600 mt-1" }, "Private conversations with other users")), /* @__PURE__ */ React__default.createElement(Input, { className: "mb-8 h-[50] rounded-md border-gray-300 border", size: "md", style: {
738
- paddingVertical: 8,
739
- marginBottom: 10,
740
- borderColor: "#d1d5db",
741
- borderRadius: 10
742
- } }, /* @__PURE__ */ React__default.createElement(InputField, { placeholder: "Search messages...", onChangeText: handleSearchChange, value: searchQuery })), /* @__PURE__ */ React__default.createElement(Center, { className: "items-center", style: {
743
- paddingVertical: 5
744
- } }, /* @__PURE__ */ React__default.createElement(Box, { className: "w-16 h-16 rounded-full bg-blue-500 flex items-center justify-center mb-5" }, /* @__PURE__ */ React__default.createElement(Ionicons, { name: "chatbubble-ellipses", size: 30, color: "white" })), /* @__PURE__ */ React__default.createElement(Text, { className: "text-2xl font-bold text-center mb-2" }, "No messages yet"), /* @__PURE__ */ React__default.createElement(Text, { className: "text-gray-600 text-center mb-8" }, "When you start conversations with others,", "\n", "they'll appear here.")));
745
301
  }
302
+ return false;
303
+ });
304
+ }, [channels, searchQuery]);
305
+ const displayChannels = filteredChannels();
306
+ return /* @__PURE__ */ React__default.createElement(Box, { className: "p-2" }, /* @__PURE__ */ React__default.createElement(FlatList, { data: displayChannels, onRefresh: handlePullToRefresh, refreshing: loading && !isLoadingMore, contentContainerStyle: {
307
+ minHeight: "100%"
308
+ }, ItemSeparatorComponent: () => /* @__PURE__ */ React__default.createElement(Box, { className: "h-0.5 bg-gray-200" }), renderItem: ({
309
+ item: channel
310
+ }) => {
311
+ const key = `${channel.type === RoomType.Service ? "service" : "direct"}-${channel.id}`;
312
+ return (channel == null ? void 0 : channel.type) === RoomType.Service ? /* @__PURE__ */ React__default.createElement(ServiceDialogsListItem, { key, onOpen: handleSelectServiceChannel, currentUser: auth, channel, refreshing: loading, selectedChannelId, role: channelRole }) : /* @__PURE__ */ React__default.createElement(DialogsListItem, { key, onOpen: handleSelectChannel, currentUser: auth, channel, selectedChannelId, forceRefresh: true });
313
+ }, ListFooterComponent: () => isLoadingMore ? /* @__PURE__ */ React__default.createElement(Center, { className: "py-4" }, /* @__PURE__ */ React__default.createElement(Spinner, { color: colors.blue[500], size: "small" })) : null, onEndReached: handleLoadMore, onEndReachedThreshold: 0.5, initialNumToRender: 5, maxToRenderPerBatch: 5, windowSize: 5, removeClippedSubviews: true, updateCellsBatchingPeriod: 100, getItemLayout: (data2, index) => ({
314
+ length: 80,
315
+ offset: 80 * index,
316
+ index
317
+ }), keyExtractor: (item) => `channel-${item.id}`, ListEmptyComponent: () => {
318
+ if (loading && displayChannels.length === 0) {
319
+ return /* @__PURE__ */ React__default.createElement(Center, { className: "flex-1 justify-center items-center", style: {
320
+ height: 300
321
+ } }, /* @__PURE__ */ React__default.createElement(Spinner, { color: colors.blue[500], size: "large" }), /* @__PURE__ */ React__default.createElement(Text, { className: "mt-4 text-gray-500" }, "Loading conversations..."));
746
322
  }
747
- ));
323
+ return /* @__PURE__ */ React__default.createElement(Box, { className: "p-6" }, /* @__PURE__ */ React__default.createElement(Box, { className: "mb-6" }, /* @__PURE__ */ React__default.createElement(Heading, { className: "text-2xl font-bold" }, "Direct Messages"), /* @__PURE__ */ React__default.createElement(Text, { className: "text-gray-600 mt-1" }, "Private conversations with other users")), /* @__PURE__ */ React__default.createElement(Input, { className: "mb-8 h-[50] rounded-md border-gray-300 border", size: "md", style: {
324
+ paddingVertical: 8,
325
+ marginBottom: 10,
326
+ borderColor: "#d1d5db",
327
+ borderRadius: 10
328
+ } }, /* @__PURE__ */ React__default.createElement(InputField, { placeholder: "Search messages...", onChangeText: handleSearchChange, value: searchQuery })), /* @__PURE__ */ React__default.createElement(Center, { className: "items-center", style: {
329
+ paddingVertical: 5
330
+ } }, /* @__PURE__ */ React__default.createElement(Box, { className: "w-16 h-16 rounded-full bg-blue-500 flex items-center justify-center mb-5" }, /* @__PURE__ */ React__default.createElement(Ionicons, { name: "chatbubble-ellipses", size: 30, color: "white" })), /* @__PURE__ */ React__default.createElement(Text, { className: "text-2xl font-bold text-center mb-2" }, "No messages yet"), /* @__PURE__ */ React__default.createElement(Text, { className: "text-gray-600 text-center mb-8" }, "When you start conversations with others,", "\n", "they'll appear here.")));
331
+ } }));
748
332
  };
749
333
  const Dialogs = React__default.memo(DialogsComponent);export{Dialogs};//# sourceMappingURL=Dialogs.js.map