beem-component 1.9.2 → 1.9.3
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.
|
@@ -236,16 +236,10 @@ var MessageState = _styledComponents.default.div.withConfig({
|
|
|
236
236
|
})(["@media all and (max-width:960px){display:none;}"]);
|
|
237
237
|
|
|
238
238
|
// End of Component for Images
|
|
239
|
-
|
|
240
|
-
// export const ReplyWrapper = styled.div`
|
|
241
|
-
// display: flex;
|
|
242
|
-
// align-items: center;
|
|
243
|
-
// gap: 1rem;
|
|
244
|
-
// `;
|
|
245
239
|
exports.MessageState = MessageState;
|
|
246
240
|
var RepliedTextWrapper = _styledComponents.default.div.withConfig({
|
|
247
241
|
displayName: "chatBody__RepliedTextWrapper"
|
|
248
|
-
})(["display:flex;flex-direction:column;justify-content:center;padding:1.14286rem 1.14286rem 1.14286rem 0.35714rem;gap:1rem;border-radius:0.25rem 0.25rem 0.25rem
|
|
242
|
+
})(["display:flex;flex-direction:column;justify-content:center;padding:1.14286rem 1.14286rem 1.14286rem 0.35714rem;gap:1rem;border-radius:0.25rem 0.25rem 0.25rem 0.25rem;border:1px solid ", ";background:", ";color:", ";"], _colors.BmGrey200, function (_ref17) {
|
|
249
243
|
var state = _ref17.state;
|
|
250
244
|
if (state) {
|
|
251
245
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
|
|
@@ -293,7 +287,7 @@ BmChat.Details = function (_ref19) {
|
|
|
293
287
|
}, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
294
288
|
metadata: metadata,
|
|
295
289
|
state: state
|
|
296
|
-
},
|
|
290
|
+
}, metadata), children) : /*#__PURE__*/_react.default.createElement(Messages, {
|
|
297
291
|
state: state
|
|
298
292
|
}, children)), file && /*#__PURE__*/_react.default.createElement(BmFileAttachment, _extends({
|
|
299
293
|
file: file,
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -1,103 +1,514 @@
|
|
|
1
1
|
// * eslint-disable func-style *
|
|
2
2
|
/* eslint-disable jsx-a11y/media-has-caption */
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import AttachFileIcon from '@mui/icons-material/AttachFile';
|
|
5
|
-
import EmojiEmotionsIcon from '@mui/icons-material/EmojiEmotions';
|
|
6
|
-
import SendIcon from '@mui/icons-material/Send';
|
|
7
|
-
import QuickreplyIcon from '@mui/icons-material/Quickreply';
|
|
8
4
|
|
|
9
|
-
import { BmChat,
|
|
5
|
+
import { BmChat, GlobalStyle } from './lib/components';
|
|
10
6
|
|
|
11
7
|
const Chat = () => {
|
|
8
|
+
const msg = [
|
|
9
|
+
{
|
|
10
|
+
message: 'Me as user replying to the beem message',
|
|
11
|
+
id: 20278,
|
|
12
|
+
time: '2024-01-22T11:59:08.000Z',
|
|
13
|
+
direction: 'inbound',
|
|
14
|
+
message_type: 'text',
|
|
15
|
+
messageId: null,
|
|
16
|
+
is_live_agent: true,
|
|
17
|
+
is_deleted: false,
|
|
18
|
+
is_comment: false,
|
|
19
|
+
channel: 'whatsapp',
|
|
20
|
+
sent_to_vendor: true,
|
|
21
|
+
replyMessageId: 'b0a6b554-0cc3-4e45-83b2-3cada229a82c',
|
|
22
|
+
agent_name: null,
|
|
23
|
+
df_agent_name: null,
|
|
24
|
+
resolve_time: null,
|
|
25
|
+
metadata: {
|
|
26
|
+
id: 'b0a6b554-0cc3-4e45-83b2-3cada229a82c',
|
|
27
|
+
prev_message: 'this is message from beem',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
message: 'this is message from beem',
|
|
32
|
+
id: 20277,
|
|
33
|
+
time: '2024-01-22T11:56:41.000Z',
|
|
34
|
+
direction: 'outbound',
|
|
35
|
+
message_type: null,
|
|
36
|
+
messageId: 'b0a6b554-0cc3-4e45-83b2-3cada229a82c',
|
|
37
|
+
is_live_agent: true,
|
|
38
|
+
is_deleted: false,
|
|
39
|
+
is_comment: false,
|
|
40
|
+
channel: 'whatsapp',
|
|
41
|
+
sent_to_vendor: true,
|
|
42
|
+
replyMessageId: null,
|
|
43
|
+
agent_name: 'arl@beem.co.tz',
|
|
44
|
+
df_agent_name: 'Dev arl',
|
|
45
|
+
resolve_time: null,
|
|
46
|
+
metadata: null,
|
|
47
|
+
statusDetails: {
|
|
48
|
+
statusCode: 3,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
message: 'hi',
|
|
53
|
+
id: 20276,
|
|
54
|
+
time: '2024-01-22T11:20:21.000Z',
|
|
55
|
+
direction: 'outbound',
|
|
56
|
+
message_type: null,
|
|
57
|
+
messageId: '86ffe4bd-145e-4f50-83ef-83248b05c43a',
|
|
58
|
+
is_live_agent: true,
|
|
59
|
+
is_deleted: false,
|
|
60
|
+
is_comment: false,
|
|
61
|
+
channel: 'whatsapp',
|
|
62
|
+
sent_to_vendor: true,
|
|
63
|
+
replyMessageId: null,
|
|
64
|
+
agent_name: 'arl@beem.co.tz',
|
|
65
|
+
df_agent_name: 'Dev arl',
|
|
66
|
+
resolve_time: null,
|
|
67
|
+
metadata: null,
|
|
68
|
+
statusDetails: {
|
|
69
|
+
statusCode: 3,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
message: 'hi',
|
|
74
|
+
id: 20270,
|
|
75
|
+
time: '2024-01-22T10:19:57.000Z',
|
|
76
|
+
direction: 'outbound',
|
|
77
|
+
message_type: null,
|
|
78
|
+
messageId: '0e165d59-8300-4cd2-883d-dcb076c6f235',
|
|
79
|
+
is_live_agent: true,
|
|
80
|
+
is_deleted: false,
|
|
81
|
+
is_comment: false,
|
|
82
|
+
channel: 'whatsapp',
|
|
83
|
+
sent_to_vendor: true,
|
|
84
|
+
replyMessageId: null,
|
|
85
|
+
agent_name: 'arl@beem.co.tz',
|
|
86
|
+
df_agent_name: 'Dev arl',
|
|
87
|
+
resolve_time: null,
|
|
88
|
+
metadata: null,
|
|
89
|
+
statusDetails: {
|
|
90
|
+
statusCode: 3,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
message: 'oh i am good',
|
|
95
|
+
id: 20269,
|
|
96
|
+
time: '2024-01-22T10:04:05.000Z',
|
|
97
|
+
direction: 'inbound',
|
|
98
|
+
message_type: 'text',
|
|
99
|
+
messageId: null,
|
|
100
|
+
is_live_agent: true,
|
|
101
|
+
is_deleted: false,
|
|
102
|
+
is_comment: false,
|
|
103
|
+
channel: 'whatsapp',
|
|
104
|
+
sent_to_vendor: true,
|
|
105
|
+
replyMessageId: null,
|
|
106
|
+
agent_name: null,
|
|
107
|
+
df_agent_name: null,
|
|
108
|
+
resolve_time: null,
|
|
109
|
+
metadata: {
|
|
110
|
+
id: 'ABEGJVeCJwBSAhB3WfEzKswmhITnP0z8qo12',
|
|
111
|
+
prev_message: 'how are you????????',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
message: 'how are you????????',
|
|
116
|
+
id: 20268,
|
|
117
|
+
time: '2024-01-22T10:03:23.000Z',
|
|
118
|
+
direction: 'inbound',
|
|
119
|
+
message_type: 'text',
|
|
120
|
+
messageId: null,
|
|
121
|
+
is_live_agent: true,
|
|
122
|
+
is_deleted: false,
|
|
123
|
+
is_comment: false,
|
|
124
|
+
channel: 'whatsapp',
|
|
125
|
+
sent_to_vendor: true,
|
|
126
|
+
replyMessageId: null,
|
|
127
|
+
agent_name: null,
|
|
128
|
+
df_agent_name: null,
|
|
129
|
+
resolve_time: null,
|
|
130
|
+
metadata: null,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
message: 'hi\n',
|
|
134
|
+
id: 20267,
|
|
135
|
+
time: '2024-01-22T10:03:01.000Z',
|
|
136
|
+
direction: 'outbound',
|
|
137
|
+
message_type: null,
|
|
138
|
+
messageId: 'f38be83c-92b1-47a7-9e6a-0d209da0ad86',
|
|
139
|
+
is_live_agent: false,
|
|
140
|
+
is_deleted: false,
|
|
141
|
+
is_comment: false,
|
|
142
|
+
channel: 'whatsapp',
|
|
143
|
+
sent_to_vendor: true,
|
|
144
|
+
replyMessageId: null,
|
|
145
|
+
agent_name: 'arl@beem.co.tz',
|
|
146
|
+
df_agent_name: 'Dev arl',
|
|
147
|
+
resolve_time: null,
|
|
148
|
+
metadata: null,
|
|
149
|
+
statusDetails: {
|
|
150
|
+
statusCode: 3,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
message: 'Sorry, what was that?',
|
|
155
|
+
id: 20266,
|
|
156
|
+
time: '2024-01-22T10:02:36.000Z',
|
|
157
|
+
direction: 'outbound',
|
|
158
|
+
message_type: 'text',
|
|
159
|
+
messageId: null,
|
|
160
|
+
is_live_agent: false,
|
|
161
|
+
is_deleted: false,
|
|
162
|
+
is_comment: false,
|
|
163
|
+
channel: 'whatsapp',
|
|
164
|
+
sent_to_vendor: true,
|
|
165
|
+
replyMessageId: null,
|
|
166
|
+
agent_name: null,
|
|
167
|
+
df_agent_name: null,
|
|
168
|
+
resolve_time: null,
|
|
169
|
+
metadata: null,
|
|
170
|
+
statusDetails: {
|
|
171
|
+
statusCode: 3,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
message: 'how are you?',
|
|
176
|
+
id: 20265,
|
|
177
|
+
time: '2024-01-22T10:02:17.000Z',
|
|
178
|
+
direction: 'inbound',
|
|
179
|
+
message_type: 'text',
|
|
180
|
+
messageId: null,
|
|
181
|
+
is_live_agent: false,
|
|
182
|
+
is_deleted: false,
|
|
183
|
+
is_comment: false,
|
|
184
|
+
channel: 'whatsapp',
|
|
185
|
+
sent_to_vendor: true,
|
|
186
|
+
replyMessageId: null,
|
|
187
|
+
agent_name: null,
|
|
188
|
+
df_agent_name: null,
|
|
189
|
+
resolve_time: null,
|
|
190
|
+
metadata: null,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
message: 'thank you for chatting with us!!! -Dev',
|
|
194
|
+
id: 20264,
|
|
195
|
+
time: '2024-01-22T09:55:00.000Z',
|
|
196
|
+
direction: 'outbound',
|
|
197
|
+
message_type: null,
|
|
198
|
+
messageId: null,
|
|
199
|
+
is_live_agent: true,
|
|
200
|
+
is_deleted: false,
|
|
201
|
+
is_comment: false,
|
|
202
|
+
channel: 'whatsapp',
|
|
203
|
+
sent_to_vendor: true,
|
|
204
|
+
replyMessageId: null,
|
|
205
|
+
agent_name: null,
|
|
206
|
+
df_agent_name: null,
|
|
207
|
+
resolve_time: null,
|
|
208
|
+
metadata: null,
|
|
209
|
+
statusDetails: {
|
|
210
|
+
statusCode: 3,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
message: 'One more time?',
|
|
215
|
+
id: 20223,
|
|
216
|
+
time: '2024-01-19T11:00:59.000Z',
|
|
217
|
+
direction: 'outbound',
|
|
218
|
+
message_type: 'text',
|
|
219
|
+
messageId: null,
|
|
220
|
+
is_live_agent: false,
|
|
221
|
+
is_deleted: false,
|
|
222
|
+
is_comment: false,
|
|
223
|
+
channel: 'whatsapp',
|
|
224
|
+
sent_to_vendor: true,
|
|
225
|
+
replyMessageId: null,
|
|
226
|
+
agent_name: null,
|
|
227
|
+
df_agent_name: null,
|
|
228
|
+
resolve_time: null,
|
|
229
|
+
metadata: null,
|
|
230
|
+
statusDetails: {
|
|
231
|
+
statusCode: 3,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
message: 'i am good',
|
|
236
|
+
id: 20222,
|
|
237
|
+
time: '2024-01-19T11:00:55.000Z',
|
|
238
|
+
direction: 'inbound',
|
|
239
|
+
message_type: 'text',
|
|
240
|
+
messageId: null,
|
|
241
|
+
is_live_agent: false,
|
|
242
|
+
is_deleted: false,
|
|
243
|
+
is_comment: false,
|
|
244
|
+
channel: 'whatsapp',
|
|
245
|
+
sent_to_vendor: true,
|
|
246
|
+
replyMessageId: null,
|
|
247
|
+
agent_name: null,
|
|
248
|
+
df_agent_name: null,
|
|
249
|
+
resolve_time: null,
|
|
250
|
+
metadata: {
|
|
251
|
+
id: 'ABEGJVaCQwSAAhCt33VV1Zivq9-48AP8bs_t',
|
|
252
|
+
prev_message: 'if it doesnt exists then to fetch',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
message: 'how are you?',
|
|
257
|
+
id: 20220,
|
|
258
|
+
time: '2024-01-19T10:59:48.000Z',
|
|
259
|
+
direction: 'inbound',
|
|
260
|
+
message_type: 'text',
|
|
261
|
+
messageId: null,
|
|
262
|
+
is_live_agent: false,
|
|
263
|
+
is_deleted: false,
|
|
264
|
+
is_comment: false,
|
|
265
|
+
channel: 'whatsapp',
|
|
266
|
+
sent_to_vendor: true,
|
|
267
|
+
replyMessageId: null,
|
|
268
|
+
agent_name: null,
|
|
269
|
+
df_agent_name: null,
|
|
270
|
+
resolve_time: null,
|
|
271
|
+
metadata: null,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
message: 'thank you for chatting with us!!! -Dev',
|
|
275
|
+
id: 20217,
|
|
276
|
+
time: '2024-01-19T09:55:00.000Z',
|
|
277
|
+
direction: 'outbound',
|
|
278
|
+
message_type: null,
|
|
279
|
+
messageId: null,
|
|
280
|
+
is_live_agent: true,
|
|
281
|
+
is_deleted: false,
|
|
282
|
+
is_comment: false,
|
|
283
|
+
channel: 'whatsapp',
|
|
284
|
+
sent_to_vendor: true,
|
|
285
|
+
replyMessageId: null,
|
|
286
|
+
agent_name: null,
|
|
287
|
+
df_agent_name: null,
|
|
288
|
+
resolve_time: null,
|
|
289
|
+
metadata: null,
|
|
290
|
+
statusDetails: {
|
|
291
|
+
statusCode: 3,
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
message: 'if it doesnt exists then to fetch',
|
|
296
|
+
id: 20208,
|
|
297
|
+
time: '2024-01-19T08:54:12.000Z',
|
|
298
|
+
direction: 'inbound',
|
|
299
|
+
message_type: 'text',
|
|
300
|
+
messageId: null,
|
|
301
|
+
is_live_agent: true,
|
|
302
|
+
is_deleted: false,
|
|
303
|
+
is_comment: false,
|
|
304
|
+
channel: 'whatsapp',
|
|
305
|
+
sent_to_vendor: true,
|
|
306
|
+
replyMessageId: null,
|
|
307
|
+
agent_name: null,
|
|
308
|
+
df_agent_name: null,
|
|
309
|
+
resolve_time: null,
|
|
310
|
+
metadata: null,
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
message: 'hi',
|
|
314
|
+
id: 20207,
|
|
315
|
+
time: '2024-01-19T08:49:23.000Z',
|
|
316
|
+
direction: 'inbound',
|
|
317
|
+
message_type: 'text',
|
|
318
|
+
messageId: null,
|
|
319
|
+
is_live_agent: true,
|
|
320
|
+
is_deleted: false,
|
|
321
|
+
is_comment: false,
|
|
322
|
+
channel: 'whatsapp',
|
|
323
|
+
sent_to_vendor: true,
|
|
324
|
+
replyMessageId: null,
|
|
325
|
+
agent_name: null,
|
|
326
|
+
df_agent_name: null,
|
|
327
|
+
resolve_time: null,
|
|
328
|
+
metadata: null,
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
message: 'hi',
|
|
332
|
+
id: 20206,
|
|
333
|
+
time: '2024-01-19T08:46:09.000Z',
|
|
334
|
+
direction: 'inbound',
|
|
335
|
+
message_type: 'text',
|
|
336
|
+
messageId: null,
|
|
337
|
+
is_live_agent: true,
|
|
338
|
+
is_deleted: false,
|
|
339
|
+
is_comment: false,
|
|
340
|
+
channel: 'whatsapp',
|
|
341
|
+
sent_to_vendor: true,
|
|
342
|
+
replyMessageId: null,
|
|
343
|
+
agent_name: null,
|
|
344
|
+
df_agent_name: null,
|
|
345
|
+
resolve_time: null,
|
|
346
|
+
metadata: null,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
message: 'hi',
|
|
350
|
+
id: 20205,
|
|
351
|
+
time: '2024-01-19T08:43:58.000Z',
|
|
352
|
+
direction: 'inbound',
|
|
353
|
+
message_type: 'text',
|
|
354
|
+
messageId: null,
|
|
355
|
+
is_live_agent: true,
|
|
356
|
+
is_deleted: false,
|
|
357
|
+
is_comment: false,
|
|
358
|
+
channel: 'whatsapp',
|
|
359
|
+
sent_to_vendor: true,
|
|
360
|
+
replyMessageId: null,
|
|
361
|
+
agent_name: null,
|
|
362
|
+
df_agent_name: null,
|
|
363
|
+
resolve_time: null,
|
|
364
|
+
metadata: null,
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
message: 'hi',
|
|
368
|
+
id: 20204,
|
|
369
|
+
time: '2024-01-19T08:41:43.000Z',
|
|
370
|
+
direction: 'inbound',
|
|
371
|
+
message_type: 'text',
|
|
372
|
+
messageId: null,
|
|
373
|
+
is_live_agent: true,
|
|
374
|
+
is_deleted: false,
|
|
375
|
+
is_comment: false,
|
|
376
|
+
channel: 'whatsapp',
|
|
377
|
+
sent_to_vendor: true,
|
|
378
|
+
replyMessageId: null,
|
|
379
|
+
agent_name: null,
|
|
380
|
+
df_agent_name: null,
|
|
381
|
+
resolve_time: null,
|
|
382
|
+
metadata: null,
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
message: 'hi',
|
|
386
|
+
id: 20201,
|
|
387
|
+
time: '2024-01-19T08:40:27.000Z',
|
|
388
|
+
direction: 'inbound',
|
|
389
|
+
message_type: 'text',
|
|
390
|
+
messageId: null,
|
|
391
|
+
is_live_agent: true,
|
|
392
|
+
is_deleted: false,
|
|
393
|
+
is_comment: false,
|
|
394
|
+
channel: 'whatsapp',
|
|
395
|
+
sent_to_vendor: true,
|
|
396
|
+
replyMessageId: null,
|
|
397
|
+
agent_name: null,
|
|
398
|
+
df_agent_name: null,
|
|
399
|
+
resolve_time: null,
|
|
400
|
+
metadata: null,
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
message: 'hi',
|
|
404
|
+
id: 20200,
|
|
405
|
+
time: '2024-01-19T08:39:19.000Z',
|
|
406
|
+
direction: 'inbound',
|
|
407
|
+
message_type: 'text',
|
|
408
|
+
messageId: null,
|
|
409
|
+
is_live_agent: true,
|
|
410
|
+
is_deleted: false,
|
|
411
|
+
is_comment: false,
|
|
412
|
+
channel: 'whatsapp',
|
|
413
|
+
sent_to_vendor: true,
|
|
414
|
+
replyMessageId: null,
|
|
415
|
+
agent_name: null,
|
|
416
|
+
df_agent_name: null,
|
|
417
|
+
resolve_time: null,
|
|
418
|
+
metadata: null,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
message: 'hi',
|
|
422
|
+
id: 20199,
|
|
423
|
+
time: '2024-01-19T08:37:26.000Z',
|
|
424
|
+
direction: 'inbound',
|
|
425
|
+
message_type: 'text',
|
|
426
|
+
messageId: null,
|
|
427
|
+
is_live_agent: true,
|
|
428
|
+
is_deleted: false,
|
|
429
|
+
is_comment: false,
|
|
430
|
+
channel: 'whatsapp',
|
|
431
|
+
sent_to_vendor: true,
|
|
432
|
+
replyMessageId: null,
|
|
433
|
+
agent_name: null,
|
|
434
|
+
df_agent_name: null,
|
|
435
|
+
resolve_time: null,
|
|
436
|
+
metadata: null,
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
message: 'hi',
|
|
440
|
+
id: 20198,
|
|
441
|
+
time: '2024-01-19T08:36:57.000Z',
|
|
442
|
+
direction: 'inbound',
|
|
443
|
+
message_type: 'text',
|
|
444
|
+
messageId: null,
|
|
445
|
+
is_live_agent: true,
|
|
446
|
+
is_deleted: false,
|
|
447
|
+
is_comment: false,
|
|
448
|
+
channel: 'whatsapp',
|
|
449
|
+
sent_to_vendor: true,
|
|
450
|
+
replyMessageId: null,
|
|
451
|
+
agent_name: null,
|
|
452
|
+
df_agent_name: null,
|
|
453
|
+
resolve_time: null,
|
|
454
|
+
metadata: null,
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
message: 'hi',
|
|
458
|
+
id: 20150,
|
|
459
|
+
time: '2024-01-18T12:47:26.000Z',
|
|
460
|
+
direction: 'inbound',
|
|
461
|
+
message_type: 'text',
|
|
462
|
+
messageId: null,
|
|
463
|
+
is_live_agent: true,
|
|
464
|
+
is_deleted: false,
|
|
465
|
+
is_comment: false,
|
|
466
|
+
channel: 'whatsapp',
|
|
467
|
+
sent_to_vendor: true,
|
|
468
|
+
replyMessageId: null,
|
|
469
|
+
agent_name: null,
|
|
470
|
+
df_agent_name: null,
|
|
471
|
+
resolve_time: null,
|
|
472
|
+
metadata: null,
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
message: 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/short.jpg',
|
|
476
|
+
id: 20147,
|
|
477
|
+
time: '2024-01-18T09:57:52.000Z',
|
|
478
|
+
direction: 'outbound',
|
|
479
|
+
message_type: 'image/png',
|
|
480
|
+
messageId: 'ea15131f-2c55-43a3-b166-c38a2c4314b1',
|
|
481
|
+
is_live_agent: true,
|
|
482
|
+
is_deleted: false,
|
|
483
|
+
is_comment: false,
|
|
484
|
+
channel: 'whatsapp',
|
|
485
|
+
sent_to_vendor: true,
|
|
486
|
+
replyMessageId: null,
|
|
487
|
+
agent_name: 'arl@beem.co.tz',
|
|
488
|
+
df_agent_name: 'Dev arl',
|
|
489
|
+
resolve_time: null,
|
|
490
|
+
metadata: null,
|
|
491
|
+
statusDetails: {
|
|
492
|
+
statusCode: 3,
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
];
|
|
12
496
|
return (
|
|
13
497
|
<>
|
|
14
498
|
<GlobalStyle />
|
|
15
499
|
|
|
16
500
|
<BmChat>
|
|
17
501
|
<BmChat.Body>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
metadata="truedsf sjdlkfj ldksfj lskdfj l"
|
|
28
|
-
/>
|
|
29
|
-
<BmChat.Details
|
|
30
|
-
state="inbound"
|
|
31
|
-
session="sms"
|
|
32
|
-
displayTime={<p>12:00pm</p>}
|
|
33
|
-
status="sent"
|
|
34
|
-
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
35
|
-
type="audio"
|
|
36
|
-
fileName={<p>file.csv</p>}
|
|
37
|
-
src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"
|
|
38
|
-
/>
|
|
39
|
-
|
|
40
|
-
<BmChat.Details
|
|
41
|
-
state="outbound"
|
|
42
|
-
session="live"
|
|
43
|
-
displayTime={<p>10:00am</p>}
|
|
44
|
-
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
45
|
-
status="failed"
|
|
46
|
-
type="video"
|
|
47
|
-
src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4"
|
|
48
|
-
/>
|
|
49
|
-
|
|
50
|
-
<BmChat.Details
|
|
51
|
-
state="outbound"
|
|
52
|
-
session="bot"
|
|
53
|
-
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
54
|
-
displayTime={<p>12:00pm</p>}
|
|
55
|
-
status="sent"
|
|
56
|
-
>
|
|
57
|
-
<p>Outbound Text Message</p>
|
|
58
|
-
</BmChat.Details>
|
|
59
|
-
<BmChat.Details
|
|
60
|
-
state="inbound"
|
|
61
|
-
session="bot"
|
|
62
|
-
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
63
|
-
displayTime={<p>12:00pm</p>}
|
|
64
|
-
status="sent"
|
|
65
|
-
metadata="trsfdsd jlskdfj sldkfj lsdkfj ldkjf lsdkfj lsdkjf lsdkjf lsdkfj ldskfj lsdkfj lsdkue"
|
|
66
|
-
>
|
|
67
|
-
<p>inboundsfhksdjfhk ksdfjh dsjfh bound Text Message</p>
|
|
68
|
-
</BmChat.Details>
|
|
69
|
-
<BmChat.Details
|
|
70
|
-
state="inbound"
|
|
71
|
-
session="bot"
|
|
72
|
-
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
73
|
-
displayTime={<p>12:00pm</p>}
|
|
74
|
-
status="sent"
|
|
75
|
-
>
|
|
76
|
-
<p>
|
|
77
|
-
inboundsfhksdjfhk ksdfjh dsjfh bound Text fjksldfj sdlfkj sdfk
|
|
78
|
-
jsdlkfj sdflkj sdlkfj ldskfj ldsj Message
|
|
79
|
-
</p>
|
|
80
|
-
</BmChat.Details>
|
|
81
|
-
<BmChat.Details
|
|
82
|
-
state="outbound"
|
|
83
|
-
session="bot"
|
|
84
|
-
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
85
|
-
displayTime={<p>12:00pm</p>}
|
|
86
|
-
status="sent"
|
|
87
|
-
metadata="tru dskfjsd dklfj sdlfkj lsdkjf lsdkfj ldskfj lsdkfj ldskfj ldskfj lsdkjt roh df ksdjflkdsjf dslfj orepgj rojgp orej hietp rjere"
|
|
88
|
-
>
|
|
89
|
-
<p>outbound dfshkf ksdfjh dsjfh bound Text Message</p>
|
|
90
|
-
</BmChat.Details>
|
|
502
|
+
{msg.map((ms) => (
|
|
503
|
+
<BmChat.Details
|
|
504
|
+
key={ms.id}
|
|
505
|
+
state={ms.direction}
|
|
506
|
+
metadata={ms.metadata ? ms.metadata.prev_message : null}
|
|
507
|
+
>
|
|
508
|
+
<p>{ms.message}</p>
|
|
509
|
+
</BmChat.Details>
|
|
510
|
+
))}
|
|
91
511
|
</BmChat.Body>
|
|
92
|
-
<BmChat.Footer>
|
|
93
|
-
<div className="chat-footer">
|
|
94
|
-
<BmIcons icon={<EmojiEmotionsIcon />} size="xlarge" />
|
|
95
|
-
<BmIcons icon={<AttachFileIcon />} size="xlarge" />
|
|
96
|
-
<BmIcons icon={<QuickreplyIcon />} size="xlarge" />
|
|
97
|
-
<BmInput placeholder="Enter Message" style={{ flex: '1' }} />
|
|
98
|
-
<BmIcons icon={<SendIcon />} size="xlarge" />
|
|
99
|
-
</div>
|
|
100
|
-
</BmChat.Footer>
|
|
101
512
|
</BmChat>
|
|
102
513
|
</>
|
|
103
514
|
);
|
|
@@ -288,7 +288,7 @@ export const RepliedTextWrapper = styled.div`
|
|
|
288
288
|
justify-content: center;
|
|
289
289
|
padding: 1.14286rem 1.14286rem 1.14286rem 0.35714rem;
|
|
290
290
|
gap: 1rem;
|
|
291
|
-
border-radius: 0.25rem 0.25rem 0.25rem
|
|
291
|
+
border-radius: 0.25rem 0.25rem 0.25rem 0.25rem;
|
|
292
292
|
border: 1px solid ${BmGrey200};
|
|
293
293
|
background: ${({ state }) => {
|
|
294
294
|
if (state) {
|
|
@@ -347,9 +347,9 @@ BmChat.Details = ({
|
|
|
347
347
|
{metadata ? (
|
|
348
348
|
<RepliedTextWrapper state={state}>
|
|
349
349
|
<Messages metadata={metadata} state={state}>
|
|
350
|
-
{
|
|
350
|
+
{metadata}
|
|
351
351
|
</Messages>
|
|
352
|
-
{
|
|
352
|
+
{children}
|
|
353
353
|
</RepliedTextWrapper>
|
|
354
354
|
) : (
|
|
355
355
|
<Messages state={state}>{children}</Messages>
|