beem-component 2.0.18 → 2.0.20
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.
|
@@ -12,19 +12,22 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var _reactAvatar = _interopRequireDefault(require("react-avatar"));
|
|
13
13
|
var _List = _interopRequireDefault(require("@mui/icons-material/List"));
|
|
14
14
|
var _ShoppingCartOutlined = _interopRequireDefault(require("@mui/icons-material/ShoppingCartOutlined"));
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
var _reactPdf = require("react-pdf");
|
|
15
17
|
var _avatars = _interopRequireDefault(require("../../Avatars/avatars"));
|
|
16
18
|
var _iconStyles = require("../../iconStyles");
|
|
17
19
|
var _sessionDetails = require("./sessionDetails");
|
|
18
20
|
var _sessionTimeline = require("./sessionTimeline");
|
|
19
21
|
var _colors = require("../../colors");
|
|
20
22
|
var _FeedPostComments = require("./FeedPostComments");
|
|
21
|
-
var _excluded = ["state", "file", "src", "fileName", "onDownload", "link"],
|
|
22
|
-
_excluded2 = ["state", "src", "fileName"],
|
|
23
|
-
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName", "metadata", "isInteractive", "type"];
|
|
23
|
+
var _excluded = ["state", "file", "src", "fileName", "onDownload", "extension", "link"],
|
|
24
|
+
_excluded2 = ["state", "src", "extensions", "fileName"],
|
|
25
|
+
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName", "metadata", "isInteractive", "type", "extension"];
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
26
28
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
29
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.js");
|
|
28
31
|
var BmChat = _styledComponents.default.div.withConfig({
|
|
29
32
|
displayName: "chatBody__BmChat"
|
|
30
33
|
})(["display:flex;flex-direction:column;height:100%;", ""], '' /* border: 0.071rem solid ${BmGrey400}; */);
|
|
@@ -34,7 +37,7 @@ BmChat.Body = _styledComponents.default.div.withConfig({
|
|
|
34
37
|
})(["display:flex;flex-direction:column-reverse;padding:0rem 1rem;flex-grow:1;overflow:auto;height:100%;"]);
|
|
35
38
|
var Details = _styledComponents.default.div.withConfig({
|
|
36
39
|
displayName: "chatBody__Details"
|
|
37
|
-
})(["display:flex;justify-content:", ";> *:not(:last-child){margin-right:1rem;margin-bottom:0.5rem;}overflow-wrap:break-word !important;word-wrap:break-word !important;margin:0rem;flex-grow:1;", ""], function (_ref) {
|
|
40
|
+
})(["display:flex;justify-content:", ";> *:not(:last-child){margin-right:1rem;margin-bottom:0.5rem;}overflow-wrap:break-word !important;word-wrap:break-word !important;margin:0rem;import{extension}from 'mime-types';flex-grow:1;", ""], function (_ref) {
|
|
38
41
|
var state = _ref.state;
|
|
39
42
|
if (state === 'inbound') {
|
|
40
43
|
return 'flex-start';
|
|
@@ -195,6 +198,9 @@ var handleState = function handleState(_ref14) {
|
|
|
195
198
|
});
|
|
196
199
|
}
|
|
197
200
|
};
|
|
201
|
+
var FileNameContainer = _styledComponents.default.div.withConfig({
|
|
202
|
+
displayName: "chatBody__FileNameContainer"
|
|
203
|
+
})(["display:flex;flex-direction:row;"]);
|
|
198
204
|
|
|
199
205
|
// Start of File Attachment
|
|
200
206
|
var FileAttachmentWrapper = _styledComponents.default.div.withConfig({
|
|
@@ -252,6 +258,7 @@ var BmFileAttachment = function BmFileAttachment(_ref20) {
|
|
|
252
258
|
src = _ref20.src,
|
|
253
259
|
fileName = _ref20.fileName,
|
|
254
260
|
onDownload = _ref20.onDownload,
|
|
261
|
+
extension = _ref20.extension,
|
|
255
262
|
link = _ref20.link,
|
|
256
263
|
rest = _objectWithoutProperties(_ref20, _excluded);
|
|
257
264
|
return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
|
|
@@ -259,7 +266,7 @@ var BmFileAttachment = function BmFileAttachment(_ref20) {
|
|
|
259
266
|
src: src
|
|
260
267
|
}, rest), /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
261
268
|
icon: /*#__PURE__*/_react.default.createElement(_FilePresent.default, null)
|
|
262
|
-
}), fileName, /*#__PURE__*/_react.default.createElement("a", {
|
|
269
|
+
}), /*#__PURE__*/_react.default.createElement(FileNameContainer, null, /*#__PURE__*/_react.default.createElement("p", null, fileName), /*#__PURE__*/_react.default.createElement("p", null, extension ? ".".concat(extension) : '')), /*#__PURE__*/_react.default.createElement("a", {
|
|
263
270
|
href: link,
|
|
264
271
|
download: true
|
|
265
272
|
}, /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
@@ -295,6 +302,7 @@ exports.BmImage = BmImage;
|
|
|
295
302
|
var BmImageChat = function BmImageChat(_ref23) {
|
|
296
303
|
var state = _ref23.state,
|
|
297
304
|
src = _ref23.src,
|
|
305
|
+
extensions = _ref23.extensions,
|
|
298
306
|
fileName = _ref23.fileName,
|
|
299
307
|
rest = _objectWithoutProperties(_ref23, _excluded2);
|
|
300
308
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BmImageWrapper, _extends({
|
|
@@ -380,11 +388,13 @@ var ListReplyRender = function ListReplyRender(_ref28) {
|
|
|
380
388
|
var title = _ref28.title,
|
|
381
389
|
body = _ref28.body,
|
|
382
390
|
globalButtons = _ref28.globalButtons,
|
|
391
|
+
isInteractive = _ref28.isInteractive,
|
|
383
392
|
type = _ref28.type,
|
|
384
393
|
state = _ref28.state;
|
|
385
394
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
386
395
|
type: type,
|
|
387
|
-
state: state
|
|
396
|
+
state: state,
|
|
397
|
+
isInteractive: isInteractive
|
|
388
398
|
}, /*#__PURE__*/_react.default.createElement("strong", null, title), /*#__PURE__*/_react.default.createElement("p", null, body), /*#__PURE__*/_react.default.createElement(IntButton, {
|
|
389
399
|
state: state
|
|
390
400
|
}, /*#__PURE__*/_react.default.createElement(_List.default, null), (_globalButtons$ = globalButtons[0]) === null || _globalButtons$ === void 0 ? void 0 : _globalButtons$.title)));
|
|
@@ -423,7 +433,9 @@ BmChat.Details = function (_ref30) {
|
|
|
423
433
|
metadata = _ref30.metadata,
|
|
424
434
|
isInteractive = _ref30.isInteractive,
|
|
425
435
|
type = _ref30.type,
|
|
436
|
+
extension = _ref30.extension,
|
|
426
437
|
rest = _objectWithoutProperties(_ref30, _excluded3);
|
|
438
|
+
console.log(src);
|
|
427
439
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Details, _extends({
|
|
428
440
|
state: state
|
|
429
441
|
}, rest), /*#__PURE__*/_react.default.createElement(MessageState, null, state === 'inbound' && session && handleState({
|
|
@@ -432,7 +444,7 @@ BmChat.Details = function (_ref30) {
|
|
|
432
444
|
agentName: agentName
|
|
433
445
|
})), /*#__PURE__*/_react.default.createElement(MessageDetails, {
|
|
434
446
|
feedPostComments: feedPostComments
|
|
435
|
-
}, src && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
447
|
+
}, src && !(0, _lodash.isUndefined)(src) && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
436
448
|
state: state,
|
|
437
449
|
src: src,
|
|
438
450
|
fileName: fileName
|
|
@@ -444,7 +456,9 @@ BmChat.Details = function (_ref30) {
|
|
|
444
456
|
}, metadata, {
|
|
445
457
|
type: type,
|
|
446
458
|
state: state
|
|
447
|
-
})) : metadata.type === 'list' ? /*#__PURE__*/_react.default.createElement(ListReplyRender, _extends({
|
|
459
|
+
})) : metadata.type === 'list' ? /*#__PURE__*/_react.default.createElement(ListReplyRender, _extends({
|
|
460
|
+
isInteractive: true
|
|
461
|
+
}, metadata, {
|
|
448
462
|
type: type,
|
|
449
463
|
state: state
|
|
450
464
|
})) : metadata.type === 'product_details' ? /*#__PURE__*/_react.default.createElement(ProductDetailRender, _extends({
|
|
@@ -472,9 +486,18 @@ BmChat.Details = function (_ref30) {
|
|
|
472
486
|
})), children.type === 'order' && /*#__PURE__*/_react.default.createElement(OrderRender, _extends({}, children, {
|
|
473
487
|
type: type,
|
|
474
488
|
state: state
|
|
489
|
+
}))) : type === 'pdf' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
490
|
+
file: {
|
|
491
|
+
url: "".concat(file)
|
|
492
|
+
}
|
|
493
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
494
|
+
pageNumber: 1,
|
|
495
|
+
height: "250",
|
|
496
|
+
width: "200"
|
|
475
497
|
}))) : /*#__PURE__*/_react.default.createElement(Messages, {
|
|
476
498
|
state: state
|
|
477
499
|
}, children))), file && /*#__PURE__*/_react.default.createElement(BmFileAttachment, _extends({
|
|
500
|
+
extension: extension,
|
|
478
501
|
file: file,
|
|
479
502
|
fileName: fileName,
|
|
480
503
|
state: state
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -5,6 +5,7 @@ import React from 'react';
|
|
|
5
5
|
// import LocalOfferOutlinedIcon from '@mui/icons-material/LocalOfferOutlined';
|
|
6
6
|
|
|
7
7
|
// import { Tooltip } from '@mui/material';
|
|
8
|
+
|
|
8
9
|
import {
|
|
9
10
|
BmChat,
|
|
10
11
|
GlobalStyle,
|
|
@@ -109,6 +110,49 @@ const Chat = () => {
|
|
|
109
110
|
// '{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"HELOOOOOOOOOO", "url": "https://i.imgur.com/BZylAb1.jpeg","text":"We value your opinion! Would you be willing to take a short survey to help us improve?","caption":""},"options":[{"type":"text","title":"Give Feedback","postbackText":"bm-feedback|0|181661e8-9209-4665-ad19-680981136ae8"},{"type":"text","title":"No Thank you","postbackText":"dev-defined-postback2"}]}}',
|
|
110
111
|
},
|
|
111
112
|
};
|
|
113
|
+
|
|
114
|
+
const messages = [
|
|
115
|
+
{
|
|
116
|
+
id: 78741,
|
|
117
|
+
message:
|
|
118
|
+
'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/0c8f668d-f5e6-4325-aa76-4d9af8dd79a7.docx',
|
|
119
|
+
time: '2025-04-03T05:55:39.000Z',
|
|
120
|
+
direction: 'inbound',
|
|
121
|
+
message_type:
|
|
122
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
123
|
+
messageId: null,
|
|
124
|
+
is_live_agent: 0,
|
|
125
|
+
is_deleted: 0,
|
|
126
|
+
is_comment: 0,
|
|
127
|
+
channel: 'whatsapp',
|
|
128
|
+
sent_to_vendor: 1,
|
|
129
|
+
replyMessageId: null,
|
|
130
|
+
agent_name: null,
|
|
131
|
+
df_agent_name: null,
|
|
132
|
+
resolve_time: null,
|
|
133
|
+
metadata: null,
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
{
|
|
137
|
+
id: 78739,
|
|
138
|
+
message:
|
|
139
|
+
'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/5f0c7de7-c42b-4a94-b1cd-9fe3554da93d.pdf',
|
|
140
|
+
time: '2025-04-03T05:50:02.000Z',
|
|
141
|
+
direction: 'inbound',
|
|
142
|
+
message_type: 'application/pdf',
|
|
143
|
+
messageId: null,
|
|
144
|
+
is_live_agent: 0,
|
|
145
|
+
is_deleted: 0,
|
|
146
|
+
is_comment: 0,
|
|
147
|
+
channel: 'whatsapp',
|
|
148
|
+
sent_to_vendor: 1,
|
|
149
|
+
replyMessageId: null,
|
|
150
|
+
agent_name: null,
|
|
151
|
+
df_agent_name: null,
|
|
152
|
+
resolve_time: null,
|
|
153
|
+
metadata: null,
|
|
154
|
+
},
|
|
155
|
+
];
|
|
112
156
|
// const msg = [
|
|
113
157
|
// {
|
|
114
158
|
// message: 'Me as user replying to the beem message',
|
|
@@ -1106,6 +1150,62 @@ const Chat = () => {
|
|
|
1106
1150
|
))}
|
|
1107
1151
|
</BmChat.Body>
|
|
1108
1152
|
</BmChat> */}
|
|
1153
|
+
|
|
1154
|
+
<BmChat>
|
|
1155
|
+
<BmChat.Body>
|
|
1156
|
+
{messages.map((ms) => {
|
|
1157
|
+
console.log(ms);
|
|
1158
|
+
return (
|
|
1159
|
+
<BmChat.Details
|
|
1160
|
+
key={ms.id}
|
|
1161
|
+
state={ms.direction}
|
|
1162
|
+
session="bot"
|
|
1163
|
+
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
1164
|
+
displayTime={<p>12:00pm</p>}
|
|
1165
|
+
status="sent"
|
|
1166
|
+
extension="pdf"
|
|
1167
|
+
file={ms.message}
|
|
1168
|
+
link={ms.message}
|
|
1169
|
+
fileName={<p>File</p>}
|
|
1170
|
+
type="pdf"
|
|
1171
|
+
style={{ margin: '-0.6% 0 0 0' }}
|
|
1172
|
+
>
|
|
1173
|
+
<p>
|
|
1174
|
+
<a href={ms.message}> </a>
|
|
1175
|
+
</p>
|
|
1176
|
+
</BmChat.Details>
|
|
1177
|
+
);
|
|
1178
|
+
})}
|
|
1179
|
+
</BmChat.Body>
|
|
1180
|
+
</BmChat>
|
|
1181
|
+
<BmChat>
|
|
1182
|
+
<BmChat.Body>
|
|
1183
|
+
{messages.map((ms) => {
|
|
1184
|
+
console.log(ms);
|
|
1185
|
+
return (
|
|
1186
|
+
<BmChat.Details
|
|
1187
|
+
key={ms.id}
|
|
1188
|
+
state={ms.direction}
|
|
1189
|
+
session="bot"
|
|
1190
|
+
sessionTimeline={{ message: <p>12:00pm</p> }}
|
|
1191
|
+
displayTime={<p>12:00pm</p>}
|
|
1192
|
+
status="sent"
|
|
1193
|
+
file={ms.message}
|
|
1194
|
+
link={ms.message}
|
|
1195
|
+
fileName={<p>File</p>}
|
|
1196
|
+
style={{ margin: '-0.6% 0 0 0' }}
|
|
1197
|
+
extension="docx"
|
|
1198
|
+
// state="inbound"
|
|
1199
|
+
// session="live"
|
|
1200
|
+
// displayTime={<p>10:00am</p>}
|
|
1201
|
+
// status="failed"
|
|
1202
|
+
// fileName={<p>file.csv</p>}
|
|
1203
|
+
// file={image}
|
|
1204
|
+
/>
|
|
1205
|
+
);
|
|
1206
|
+
})}
|
|
1207
|
+
</BmChat.Body>
|
|
1208
|
+
</BmChat>
|
|
1109
1209
|
</>
|
|
1110
1210
|
);
|
|
1111
1211
|
};
|
|
@@ -8,6 +8,8 @@ import styled from 'styled-components';
|
|
|
8
8
|
import Avatar from 'react-avatar';
|
|
9
9
|
import ListIcon from '@mui/icons-material/List';
|
|
10
10
|
import ShoppingCartOutlinedIcon from '@mui/icons-material/ShoppingCartOutlined';
|
|
11
|
+
import { isUndefined } from 'lodash';
|
|
12
|
+
import { Document, pdfjs, Page } from 'react-pdf';
|
|
11
13
|
import BmAvatar from '../../Avatars/avatars';
|
|
12
14
|
import { BmIcons } from '../../iconStyles';
|
|
13
15
|
import { SessionDetails } from './sessionDetails';
|
|
@@ -24,6 +26,8 @@ import {
|
|
|
24
26
|
} from '../../colors';
|
|
25
27
|
import { BmFeedPostComments } from './FeedPostComments';
|
|
26
28
|
|
|
29
|
+
pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
|
|
30
|
+
|
|
27
31
|
const BmChat = styled.div`
|
|
28
32
|
display: flex;
|
|
29
33
|
flex-direction: column;
|
|
@@ -57,7 +61,8 @@ const Details = styled.div`
|
|
|
57
61
|
}
|
|
58
62
|
overflow-wrap: break-word !important;
|
|
59
63
|
word-wrap: break-word !important;
|
|
60
|
-
margin: 0rem;
|
|
64
|
+
margin: 0rem;import { extension } from 'mime-types';
|
|
65
|
+
|
|
61
66
|
flex-grow: 1;
|
|
62
67
|
${'' /* border: 1px solid red; */}
|
|
63
68
|
`;
|
|
@@ -233,6 +238,10 @@ const handleState = ({ session, agentName }) => {
|
|
|
233
238
|
return <BmAvatar size="small" user="sms" />;
|
|
234
239
|
}
|
|
235
240
|
};
|
|
241
|
+
const FileNameContainer = styled.div`
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-direction: row;
|
|
244
|
+
`;
|
|
236
245
|
|
|
237
246
|
// Start of File Attachment
|
|
238
247
|
const FileAttachmentWrapper = styled.div`
|
|
@@ -307,6 +316,7 @@ const BmFileAttachment = ({
|
|
|
307
316
|
src,
|
|
308
317
|
fileName,
|
|
309
318
|
onDownload,
|
|
319
|
+
extension,
|
|
310
320
|
link,
|
|
311
321
|
...rest
|
|
312
322
|
}) => {
|
|
@@ -314,7 +324,10 @@ const BmFileAttachment = ({
|
|
|
314
324
|
<FileAttachmentWrapper state={state} src={src} {...rest}>
|
|
315
325
|
<BmIcons icon={<FilePresentIcon />} />
|
|
316
326
|
{/* {fileName} */}
|
|
317
|
-
|
|
327
|
+
<FileNameContainer>
|
|
328
|
+
<p>{fileName}</p>
|
|
329
|
+
<p>{extension ? `.${extension}` : ''}</p>
|
|
330
|
+
</FileNameContainer>
|
|
318
331
|
<a href={link} download>
|
|
319
332
|
<BmIcons
|
|
320
333
|
style={{
|
|
@@ -355,7 +368,7 @@ export const BmImage = styled.img`
|
|
|
355
368
|
}};
|
|
356
369
|
`;
|
|
357
370
|
|
|
358
|
-
export const BmImageChat = ({ state, src, fileName, ...rest }) => {
|
|
371
|
+
export const BmImageChat = ({ state, src, extensions, fileName, ...rest }) => {
|
|
359
372
|
return (
|
|
360
373
|
<>
|
|
361
374
|
<BmImageWrapper state={state} {...rest}>
|
|
@@ -445,10 +458,17 @@ const ProductDetailRender = ({ type, state, header, body, isInteractive }) => {
|
|
|
445
458
|
</>
|
|
446
459
|
);
|
|
447
460
|
};
|
|
448
|
-
const ListReplyRender = ({
|
|
461
|
+
const ListReplyRender = ({
|
|
462
|
+
title,
|
|
463
|
+
body,
|
|
464
|
+
globalButtons,
|
|
465
|
+
isInteractive,
|
|
466
|
+
type,
|
|
467
|
+
state,
|
|
468
|
+
}) => {
|
|
449
469
|
return (
|
|
450
470
|
<>
|
|
451
|
-
<Messages type={type} state={state}>
|
|
471
|
+
<Messages type={type} state={state} isInteractive={isInteractive}>
|
|
452
472
|
<strong>{title}</strong>
|
|
453
473
|
<p>{body}</p>
|
|
454
474
|
<IntButton state={state}>
|
|
@@ -496,8 +516,10 @@ BmChat.Details = ({
|
|
|
496
516
|
metadata,
|
|
497
517
|
isInteractive,
|
|
498
518
|
type,
|
|
519
|
+
extension,
|
|
499
520
|
...rest
|
|
500
521
|
}) => {
|
|
522
|
+
console.log(src);
|
|
501
523
|
return (
|
|
502
524
|
<>
|
|
503
525
|
<Details state={state} {...rest}>
|
|
@@ -509,7 +531,7 @@ BmChat.Details = ({
|
|
|
509
531
|
</MessageState>
|
|
510
532
|
<MessageDetails feedPostComments={feedPostComments}>
|
|
511
533
|
{/* For Images */}
|
|
512
|
-
{src && (
|
|
534
|
+
{src && !isUndefined(src) && (
|
|
513
535
|
<BmImageChat
|
|
514
536
|
state={state}
|
|
515
537
|
src={src}
|
|
@@ -531,7 +553,12 @@ BmChat.Details = ({
|
|
|
531
553
|
state={state}
|
|
532
554
|
/>
|
|
533
555
|
) : metadata.type === 'list' ? (
|
|
534
|
-
<ListReplyRender
|
|
556
|
+
<ListReplyRender
|
|
557
|
+
isInteractive
|
|
558
|
+
{...metadata}
|
|
559
|
+
type={type}
|
|
560
|
+
state={state}
|
|
561
|
+
/>
|
|
535
562
|
) : metadata.type === 'product_details' ? (
|
|
536
563
|
<ProductDetailRender
|
|
537
564
|
isInteractive
|
|
@@ -577,6 +604,16 @@ BmChat.Details = ({
|
|
|
577
604
|
<OrderRender {...children} type={type} state={state} />
|
|
578
605
|
)}
|
|
579
606
|
</>
|
|
607
|
+
) : type === 'pdf' ? (
|
|
608
|
+
<>
|
|
609
|
+
<Document
|
|
610
|
+
file={{
|
|
611
|
+
url: `${file}`,
|
|
612
|
+
}}
|
|
613
|
+
>
|
|
614
|
+
<Page pageNumber={1} height="250" width="200" />
|
|
615
|
+
</Document>
|
|
616
|
+
</>
|
|
580
617
|
) : (
|
|
581
618
|
<Messages state={state}>{children}</Messages>
|
|
582
619
|
)}
|
|
@@ -587,6 +624,7 @@ BmChat.Details = ({
|
|
|
587
624
|
{/* For files */}
|
|
588
625
|
{file && (
|
|
589
626
|
<BmFileAttachment
|
|
627
|
+
extension={extension}
|
|
590
628
|
file={file}
|
|
591
629
|
fileName={fileName}
|
|
592
630
|
state={state}
|