@droppii-org/chat-mobile 0.2.15 → 0.2.17
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.
- package/lib/module/components/AttachmentPreview.js +9 -7
- package/lib/module/components/AttachmentPreview.js.map +1 -1
- package/lib/module/components/MergedImageGrid.js +28 -18
- package/lib/module/components/MergedImageGrid.js.map +1 -1
- package/lib/module/components/ThreadCard/ThreadCard.js +2 -1
- package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
- package/lib/module/components/messages/imageMessage/index.js.map +1 -1
- package/lib/module/components/messages/mergedMessage/index.js +4 -7
- package/lib/module/components/messages/mergedMessage/index.js.map +1 -1
- package/lib/module/hooks/useImageAttachment.js +50 -71
- package/lib/module/hooks/useImageAttachment.js.map +1 -1
- package/lib/module/hooks/useVideoAttachment.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/screens/MediaView/VideoPlayer.js +1 -0
- package/lib/module/screens/MediaView/VideoPlayer.js.map +1 -1
- package/lib/module/screens/MediaView/index.js +8 -10
- package/lib/module/screens/MediaView/index.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatComposer.js +10 -3
- package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +11 -2
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js +66 -25
- package/lib/module/screens/chat-detail/hooks/useAttachmentSendHandler.js.map +1 -1
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js +6 -3
- package/lib/module/services/attachmentHandlers/imageAttachmentHandler.js.map +1 -1
- package/lib/module/services/attachmentHandlers/videoAttachmentHandler.js +1 -1
- package/lib/module/services/auth.js +69 -0
- package/lib/module/services/auth.js.map +1 -1
- package/lib/module/services/imageUpload.js +84 -58
- package/lib/module/services/imageUpload.js.map +1 -1
- package/lib/module/translation/resources/i18n.js +1 -0
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/utils/chatImageDimens.js +18 -1
- package/lib/module/utils/chatImageDimens.js.map +1 -1
- package/lib/module/utils/dateTimeUtils.js +44 -0
- package/lib/module/utils/dateTimeUtils.js.map +1 -0
- package/lib/module/utils/device.js +2 -1
- package/lib/module/utils/device.js.map +1 -1
- package/lib/module/utils/imageUtils.js +4 -2
- package/lib/module/utils/imageUtils.js.map +1 -1
- package/lib/module/{components/ThreadCard/thread-card.utils.js → utils/messageUtils.js} +18 -42
- package/lib/module/utils/messageUtils.js.map +1 -0
- package/lib/module/utils/videoThumbnail.js +86 -7
- package/lib/module/utils/videoThumbnail.js.map +1 -1
- package/lib/typescript/src/components/AttachmentPreview.d.ts.map +1 -1
- package/lib/typescript/src/components/MergedImageGrid.d.ts +2 -2
- package/lib/typescript/src/components/MergedImageGrid.d.ts.map +1 -1
- package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/imageMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/components/messages/mergedMessage/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useImageAttachment.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/MediaView/VideoPlayer.d.ts.map +1 -1
- package/lib/typescript/src/screens/MediaView/index.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/hooks/useAttachmentSendHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/attachmentHandlers/imageAttachmentHandler.d.ts.map +1 -1
- package/lib/typescript/src/services/auth.d.ts +32 -0
- package/lib/typescript/src/services/auth.d.ts.map +1 -1
- package/lib/typescript/src/services/imageUpload.d.ts.map +1 -1
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/utils/chatImageDimens.d.ts +1 -0
- package/lib/typescript/src/utils/chatImageDimens.d.ts.map +1 -1
- package/lib/typescript/src/utils/dateTimeUtils.d.ts +6 -0
- package/lib/typescript/src/utils/dateTimeUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/device.d.ts.map +1 -1
- package/lib/typescript/src/utils/imageUtils.d.ts.map +1 -1
- package/lib/typescript/src/utils/messageUtils.d.ts +8 -0
- package/lib/typescript/src/utils/messageUtils.d.ts.map +1 -0
- package/lib/typescript/src/utils/videoThumbnail.d.ts +1 -0
- package/lib/typescript/src/utils/videoThumbnail.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/AttachmentPreview.tsx +11 -5
- package/src/components/MergedImageGrid.tsx +36 -23
- package/src/components/ThreadCard/ThreadCard.tsx +2 -1
- package/src/components/messages/imageMessage/index.tsx +0 -1
- package/src/components/messages/mergedMessage/index.tsx +5 -7
- package/src/hooks/useImageAttachment.ts +67 -82
- package/src/hooks/useVideoAttachment.ts +1 -1
- package/src/index.tsx +8 -1
- package/src/screens/MediaView/VideoPlayer.tsx +1 -0
- package/src/screens/MediaView/index.tsx +8 -7
- package/src/screens/chat-detail/ChatComposer.tsx +9 -3
- package/src/screens/chat-detail/ChatListLegend.tsx +9 -2
- package/src/screens/chat-detail/hooks/useAttachmentSendHandler.ts +81 -25
- package/src/services/attachmentHandlers/imageAttachmentHandler.ts +11 -1
- package/src/services/attachmentHandlers/videoAttachmentHandler.ts +1 -1
- package/src/services/auth.ts +77 -0
- package/src/services/imageUpload.ts +116 -73
- package/src/translation/resources/i18n.ts +1 -0
- package/src/utils/chatImageDimens.ts +21 -1
- package/src/utils/dateTimeUtils.ts +48 -0
- package/src/utils/device.ts +1 -0
- package/src/utils/imageUtils.ts +10 -2
- package/src/{components/ThreadCard/thread-card.utils.ts → utils/messageUtils.ts} +18 -56
- package/src/utils/videoThumbnail.ts +90 -5
- package/lib/module/components/ThreadCard/thread-card.utils.js.map +0 -1
- package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts +0 -4
- package/lib/typescript/src/components/ThreadCard/thread-card.utils.d.ts.map +0 -1
package/src/utils/device.ts
CHANGED
package/src/utils/imageUtils.ts
CHANGED
|
@@ -24,6 +24,8 @@ export const getMimeType = (fileName: string): string => {
|
|
|
24
24
|
jpeg: 'image/jpeg',
|
|
25
25
|
png: 'image/png',
|
|
26
26
|
webp: 'image/webp',
|
|
27
|
+
heic: 'image/heic',
|
|
28
|
+
heif: 'image/heif',
|
|
27
29
|
mp4: 'video/mp4',
|
|
28
30
|
mov: 'video/quicktime',
|
|
29
31
|
avi: 'video/x-msvideo',
|
|
@@ -63,9 +65,15 @@ export const validateImageFile = (file: ImageFile): string | null => {
|
|
|
63
65
|
return `Image too large. Max ${formatFileSize(MAX_SIZE)}`;
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
const validMimes = [
|
|
68
|
+
const validMimes = [
|
|
69
|
+
'image/jpeg',
|
|
70
|
+
'image/png',
|
|
71
|
+
'image/webp',
|
|
72
|
+
'image/heic',
|
|
73
|
+
'image/heif',
|
|
74
|
+
];
|
|
67
75
|
if (!validMimes.includes(file.mime)) {
|
|
68
|
-
return 'Unsupported format. Only JPEG, PNG, WebP';
|
|
76
|
+
return 'Unsupported format. Only JPEG, PNG, WebP, HEIC';
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
return null;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message formatting and preview utilities
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
import { MessageType } from '@droppii/openim-rn-client-sdk';
|
|
2
|
-
import type { DMessageItem } from '
|
|
3
|
-
import { DChatMessageType } from '
|
|
6
|
+
import type { DMessageItem } from '../types/chat';
|
|
7
|
+
import { DChatMessageType } from '../types/message';
|
|
8
|
+
import { formatDuration } from './dateTimeUtils';
|
|
4
9
|
|
|
5
|
-
const extractTextContent = (message: DMessageItem): string => {
|
|
10
|
+
export const extractTextContent = (message: DMessageItem): string => {
|
|
6
11
|
if (message.textElem?.content) return message.textElem.content;
|
|
7
12
|
try {
|
|
8
13
|
const parsed = JSON.parse(message.content) as { content?: string };
|
|
@@ -12,13 +17,7 @@ const extractTextContent = (message: DMessageItem): string => {
|
|
|
12
17
|
}
|
|
13
18
|
};
|
|
14
19
|
|
|
15
|
-
const
|
|
16
|
-
const mins = Math.floor(seconds / 60);
|
|
17
|
-
const secs = seconds % 60;
|
|
18
|
-
return `${mins}:${secs.toString().padStart(2, '0')}`;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const getMessagePreview = (message: DMessageItem): string => {
|
|
20
|
+
export const getMessagePreview = (message: DMessageItem): string => {
|
|
22
21
|
// Check custom message type first
|
|
23
22
|
if (message.contentType === MessageType.CustomMessage) {
|
|
24
23
|
try {
|
|
@@ -49,8 +48,8 @@ const getMessagePreview = (message: DMessageItem): string => {
|
|
|
49
48
|
|
|
50
49
|
case MessageType.VideoMessage:
|
|
51
50
|
try {
|
|
52
|
-
const videoData =
|
|
53
|
-
const duration = videoData
|
|
51
|
+
const videoData = message?.videoElem;
|
|
52
|
+
const duration = videoData?.duration || 0;
|
|
54
53
|
const durationStr = duration > 0 ? ` ${formatDuration(duration)}` : '';
|
|
55
54
|
return `[Video]${durationStr}`;
|
|
56
55
|
} catch {
|
|
@@ -75,7 +74,7 @@ const getMessagePreview = (message: DMessageItem): string => {
|
|
|
75
74
|
(msg: any) => msg.contentType === MessageType.PictureMessage
|
|
76
75
|
).length;
|
|
77
76
|
if (imageCount > 0) {
|
|
78
|
-
return
|
|
77
|
+
return '[Hình ảnh]';
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
} catch {
|
|
@@ -108,52 +107,15 @@ export const getLastMessageText = (
|
|
|
108
107
|
const preview = getMessagePreview(message);
|
|
109
108
|
if (!preview) return '';
|
|
110
109
|
|
|
111
|
-
// Add sender name
|
|
110
|
+
// Add sender name for outgoing messages
|
|
112
111
|
if (currentUserId && message.sendID === currentUserId) {
|
|
113
112
|
return `Bạn: ${preview}`;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export const formatTimestamp = (ts: number | string | null): string => {
|
|
120
|
-
if (!ts) return '';
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
const date = new Date(ts);
|
|
124
|
-
if (isNaN(date.getTime())) return '';
|
|
125
|
-
|
|
126
|
-
const now = new Date();
|
|
127
|
-
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
128
|
-
const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
|
|
129
|
-
const dateOnly = new Date(
|
|
130
|
-
date.getFullYear(),
|
|
131
|
-
date.getMonth(),
|
|
132
|
-
date.getDate()
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
if (dateOnly.getTime() === today.getTime()) {
|
|
136
|
-
const h = date.getHours().toString().padStart(2, '0');
|
|
137
|
-
const m = date.getMinutes().toString().padStart(2, '0');
|
|
138
|
-
return `${h}:${m}`;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (dateOnly.getTime() === yesterday.getTime()) {
|
|
142
|
-
return 'Hôm qua';
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const daysAgo = Math.floor(
|
|
146
|
-
(today.getTime() - dateOnly.getTime()) / (24 * 60 * 60 * 1000)
|
|
147
|
-
);
|
|
148
|
-
if (daysAgo > 0 && daysAgo < 7) {
|
|
149
|
-
const dayNames = ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'];
|
|
150
|
-
return dayNames[date.getDay()] ?? '';
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const d = date.getDate().toString().padStart(2, '0');
|
|
154
|
-
const mo = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
155
|
-
return `${d}/${mo}`;
|
|
156
|
-
} catch {
|
|
157
|
-
return '';
|
|
115
|
+
// Add sender nickname for incoming messages
|
|
116
|
+
if (message.senderNickname) {
|
|
117
|
+
return `${message.senderNickname}: ${preview}`;
|
|
158
118
|
}
|
|
119
|
+
|
|
120
|
+
return preview;
|
|
159
121
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
1
2
|
import RNFS from 'react-native-fs';
|
|
2
3
|
import { createThumbnail } from 'react-native-create-thumbnail';
|
|
3
4
|
|
|
4
5
|
interface ThumbnailOptions {
|
|
5
6
|
time?: number; // timestamp in milliseconds (default: 0)
|
|
6
7
|
quality?: number; // 0-100 (default: 100)
|
|
8
|
+
cacheId?: string; // unique cache identifier for this thumbnail (optional)
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
interface ThumbnailResult {
|
|
@@ -12,26 +14,102 @@ interface ThumbnailResult {
|
|
|
12
14
|
height: number;
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Routes the video source so react-native-create-thumbnail picks the correct
|
|
19
|
+
* native MediaMetadataRetriever.setDataSource overload.
|
|
20
|
+
*
|
|
21
|
+
* Root cause of the Android crash: CreateThumbnailModule.getBitmapAtTime branches
|
|
22
|
+
* on the URL scheme —
|
|
23
|
+
* - "file://..." -> setDataSource(String) ✅ works for local files
|
|
24
|
+
* - "content://" -> setDataSource(Context, Uri)
|
|
25
|
+
* - otherwise -> setDataSource(String, Map headers) ❌ this overload is for
|
|
26
|
+
* REMOTE URIs; a bare local path makes it throw an uncaught
|
|
27
|
+
* RuntimeException (status 0xFFFFFFEA / EINVAL) → app crash.
|
|
28
|
+
* The app strips "file://" before calling, so local videos fall into the broken
|
|
29
|
+
* branch. The fix is to KEEP the file:// scheme so the working overload is used.
|
|
30
|
+
*
|
|
31
|
+
* For Android photo-picker synthetic paths we additionally copy the file into the
|
|
32
|
+
* app cache first (a clean, app-private file the retriever can always open) and
|
|
33
|
+
* still hand it back with a file:// prefix. Returns the path to pass to
|
|
34
|
+
* createThumbnail plus a raw cleanup path for any temp copy.
|
|
35
|
+
*/
|
|
36
|
+
const ensureRetrievableVideoPath = async (
|
|
37
|
+
videoPath: string
|
|
38
|
+
): Promise<{ path: string; cleanupPath: string | null }> => {
|
|
39
|
+
// iOS (and any non-Android platform) is left completely untouched.
|
|
40
|
+
if (Platform.OS !== 'android') {
|
|
41
|
+
return { path: videoPath, cleanupPath: null };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// content:// is handled by a dedicated native branch — pass through unchanged.
|
|
45
|
+
if (videoPath.startsWith('content://')) {
|
|
46
|
+
return { path: videoPath, cleanupPath: null };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const rawPath = videoPath.startsWith('file://')
|
|
50
|
+
? videoPath.replace('file://', '')
|
|
51
|
+
: videoPath;
|
|
52
|
+
|
|
53
|
+
const isSynthetic =
|
|
54
|
+
rawPath.includes('/.transforms/') || rawPath.includes('/synthetic/');
|
|
55
|
+
|
|
56
|
+
if (isSynthetic) {
|
|
57
|
+
const ext = (rawPath.split('.').pop() || 'mp4').split('?')[0];
|
|
58
|
+
const dest = `${RNFS.CachesDirectoryPath}/video-thumb-src-${Date.now()}-${Math.floor(
|
|
59
|
+
Math.random() * 1e6
|
|
60
|
+
)}.${ext}`;
|
|
61
|
+
|
|
62
|
+
console.log(
|
|
63
|
+
'[VideoThumbnail] Copying picker video to cache before thumbnail',
|
|
64
|
+
{ from: rawPath, to: dest }
|
|
65
|
+
);
|
|
66
|
+
await RNFS.copyFile(rawPath, dest);
|
|
67
|
+
return { path: `file://${dest}`, cleanupPath: dest };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Any other local path: ensure the file:// scheme so the native module routes
|
|
71
|
+
// to setDataSource(String) instead of the broken (String, Map) overload.
|
|
72
|
+
return { path: `file://${rawPath}`, cleanupPath: null };
|
|
73
|
+
};
|
|
74
|
+
|
|
15
75
|
export const VideoThumbnailUtil = {
|
|
16
76
|
generateThumbnail: async (
|
|
17
77
|
videoPath: string,
|
|
18
78
|
options: ThumbnailOptions = {}
|
|
19
79
|
): Promise<ThumbnailResult | null> => {
|
|
20
|
-
const { time =
|
|
80
|
+
const { time = 800, quality = 80, cacheId } = options; // time in milliseconds
|
|
81
|
+
|
|
82
|
+
let tempSourcePath: string | null = null;
|
|
21
83
|
|
|
22
84
|
try {
|
|
85
|
+
// Normalize the source so the native MediaMetadataRetriever can open it.
|
|
86
|
+
// Android picker paths crash the app otherwise (see ensureRetrievableVideoPath).
|
|
87
|
+
const { path: retrievablePath, cleanupPath } =
|
|
88
|
+
await ensureRetrievableVideoPath(videoPath);
|
|
89
|
+
tempSourcePath = cleanupPath;
|
|
90
|
+
|
|
91
|
+
// Generate unique cache name per video to avoid conflicts with concurrent generations
|
|
92
|
+
// Uses provided cacheId or generates one from videoPath filename
|
|
93
|
+
const fileName = retrievablePath.split('/').pop() || String(Date.now());
|
|
94
|
+
const cacheName =
|
|
95
|
+
cacheId ||
|
|
96
|
+
`thumb-${fileName.replace(/[^a-zA-Z0-9-_]/g, '')}-${Math.abs(
|
|
97
|
+
fileName.charCodeAt(0) + fileName.charCodeAt(fileName.length - 1)
|
|
98
|
+
)}`;
|
|
99
|
+
|
|
23
100
|
console.log('[VideoThumbnail] Generating thumbnail', {
|
|
24
|
-
videoPath,
|
|
101
|
+
videoPath: retrievablePath,
|
|
25
102
|
timeMs: time,
|
|
26
103
|
quality,
|
|
104
|
+
cacheName,
|
|
27
105
|
});
|
|
28
106
|
|
|
29
107
|
const result = await createThumbnail({
|
|
30
|
-
url:
|
|
108
|
+
url: retrievablePath,
|
|
31
109
|
timeStamp: time,
|
|
32
|
-
format: '
|
|
110
|
+
format: 'png',
|
|
33
111
|
dirSize: 100,
|
|
34
|
-
cacheName
|
|
112
|
+
cacheName,
|
|
35
113
|
});
|
|
36
114
|
|
|
37
115
|
console.log('✅ [VideoThumbnail] THUMBNAIL PATH:', result.path);
|
|
@@ -49,6 +127,13 @@ export const VideoThumbnailUtil = {
|
|
|
49
127
|
} catch (error) {
|
|
50
128
|
console.error('[VideoThumbnail] Failed to generate thumbnail', error);
|
|
51
129
|
return null;
|
|
130
|
+
} finally {
|
|
131
|
+
// Remove the temporary video copy made for synthetic/content sources.
|
|
132
|
+
if (tempSourcePath) {
|
|
133
|
+
RNFS.unlink(tempSourcePath).catch((err) =>
|
|
134
|
+
console.warn('[VideoThumbnail] Temp source cleanup failed:', err)
|
|
135
|
+
);
|
|
136
|
+
}
|
|
52
137
|
}
|
|
53
138
|
},
|
|
54
139
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MessageType","DChatMessageType","extractTextContent","message","textElem","content","parsed","JSON","parse","formatDuration","seconds","mins","Math","floor","secs","toString","padStart","getMessagePreview","contentType","CustomMessage","data","dataType","type","Link","linkText","title","Order","orderCode","code","TextMessage","PictureMessage","VideoMessage","videoData","duration","durationStr","FileMessage","fileData","fileName","name","MergeMessage","mergeData","mergeElem","multiMessage","imageCount","filter","msg","length","UrlTextMessage","urlText","urlTextElem","urls","console","log","AtTextMessage","QuoteMessage","getLastMessageText","currentUserId","preview","sendID","formatTimestamp","ts","date","Date","isNaN","getTime","now","today","getFullYear","getMonth","getDate","yesterday","dateOnly","h","getHours","m","getMinutes","daysAgo","dayNames","getDay","d","mo"],"sourceRoot":"../../../../src","sources":["components/ThreadCard/thread-card.utils.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,+BAA+B;AAE3D,SAASC,gBAAgB,QAAQ,wBAAqB;AAEtD,MAAMC,kBAAkB,GAAIC,OAAqB,IAAa;EAC5D,IAAIA,OAAO,CAACC,QAAQ,EAAEC,OAAO,EAAE,OAAOF,OAAO,CAACC,QAAQ,CAACC,OAAO;EAC9D,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACL,OAAO,CAACE,OAAO,CAAyB;IAClE,OAAOC,MAAM,CAACD,OAAO,IAAI,EAAE;EAC7B,CAAC,CAAC,MAAM;IACN,OAAOF,OAAO,C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AAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IAC5D,OAAO,GAAG+D,CAAC,IAAIC,EAAE,EAAE;EACrB,CAAC,CAAC,MAAM;IACN,OAAO,EAAE;EACX;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DMessageItem } from '../../types/chat';
|
|
2
|
-
export declare const getLastMessageText: (message: DMessageItem | undefined, currentUserId?: string) => string;
|
|
3
|
-
export declare const formatTimestamp: (ts: number | string | null) => string;
|
|
4
|
-
//# sourceMappingURL=thread-card.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"thread-card.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/ThreadCard/thread-card.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAoGrD,eAAO,MAAM,kBAAkB,GAC7B,SAAS,YAAY,GAAG,SAAS,EACjC,gBAAgB,MAAM,KACrB,MAYF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,MAwC5D,CAAC"}
|