beem-component 2.0.21 → 2.0.23

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.
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = exports.RepliedTextWrapper = exports.MessageState = exports.BmImageWrapper = exports.BmImageChat = exports.BmImage = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
8
9
  var _icons = require("@material-ui/icons");
9
10
  var _FilePresent = _interopRequireDefault(require("@mui/icons-material/FilePresent"));
10
11
  var _Download = _interopRequireDefault(require("@mui/icons-material/Download"));
@@ -24,6 +25,14 @@ var _excluded = ["state", "file", "src", "fileName", "onDownload", "extension",
24
25
  _excluded2 = ["state", "src", "extensions", "fileName"],
25
26
  _excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName", "metadata", "isInteractive", "type", "extension"];
26
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
31
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
32
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
34
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
35
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
36
  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); }
28
37
  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; }
29
38
  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; }
@@ -149,6 +158,9 @@ var OrderBody = _styledComponents.default.button.withConfig({
149
158
  }
150
159
  return "".concat(_colors.BmPrimaryWhite);
151
160
  });
161
+ var ProductImage = _styledComponents.default.img.withConfig({
162
+ displayName: "chatBody__ProductImage"
163
+ })(["width:50px;height:50px;border-radius:50%;padding:5px;"]);
152
164
  var CartContent = _styledComponents.default.div.withConfig({
153
165
  displayName: "chatBody__CartContent"
154
166
  })(["margin-bottom:0.5rem;display:flex;flex-direction:row;align-items:center;justify-content:center;color:", ";"], function (_ref12) {
@@ -344,6 +356,7 @@ var RepliedTextWrapper = _styledComponents.default.div.withConfig({
344
356
  });
345
357
  exports.RepliedTextWrapper = RepliedTextWrapper;
346
358
  var QuickReplyRender = function QuickReplyRender(_ref26) {
359
+ var _content$text;
347
360
  var content = _ref26.content,
348
361
  options = _ref26.options,
349
362
  type = _ref26.type,
@@ -358,7 +371,9 @@ var QuickReplyRender = function QuickReplyRender(_ref26) {
358
371
  }, (content === null || content === void 0 ? void 0 : content.url) && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
359
372
  state: state,
360
373
  src: content === null || content === void 0 ? void 0 : content.url
361
- }, rest)), /*#__PURE__*/_react.default.createElement("strong", null, content === null || content === void 0 ? void 0 : content.header), /*#__PURE__*/_react.default.createElement("p", null, content === null || content === void 0 ? void 0 : content.text), /*#__PURE__*/_react.default.createElement("small", null, content === null || content === void 0 ? void 0 : content.caption), options === null || options === void 0 ? void 0 : options.map(function (button) {
374
+ }, rest)), /*#__PURE__*/_react.default.createElement("strong", null, content === null || content === void 0 ? void 0 : content.header), content === null || content === void 0 ? void 0 : (_content$text = content.text) === null || _content$text === void 0 ? void 0 : _content$text.split('\n').map(function (line) {
375
+ return /*#__PURE__*/_react.default.createElement("p", null, line, /*#__PURE__*/_react.default.createElement("br", null));
376
+ }), /*#__PURE__*/_react.default.createElement("small", null, content === null || content === void 0 ? void 0 : content.caption), options === null || options === void 0 ? void 0 : options.map(function (button) {
362
377
  return (
363
378
  /*#__PURE__*/
364
379
  // eslint-disable-next-line react/jsx-key
@@ -395,7 +410,9 @@ var ListReplyRender = function ListReplyRender(_ref28) {
395
410
  type: type,
396
411
  state: state,
397
412
  isInteractive: isInteractive
398
- }, /*#__PURE__*/_react.default.createElement("strong", null, title), /*#__PURE__*/_react.default.createElement("p", null, body), /*#__PURE__*/_react.default.createElement(IntButton, {
413
+ }, /*#__PURE__*/_react.default.createElement("strong", null, title), body.split('\n').map(function (line) {
414
+ return /*#__PURE__*/_react.default.createElement("p", null, line, /*#__PURE__*/_react.default.createElement("br", null));
415
+ }), /*#__PURE__*/_react.default.createElement(IntButton, {
399
416
  state: state
400
417
  }, /*#__PURE__*/_react.default.createElement(_List.default, null), (_globalButtons$ = globalButtons[0]) === null || _globalButtons$ === void 0 ? void 0 : _globalButtons$.title)));
401
418
  };
@@ -403,7 +420,12 @@ var OrderRender = function OrderRender(_ref29) {
403
420
  var count = _ref29.count,
404
421
  amount = _ref29.amount,
405
422
  type = _ref29.type,
406
- state = _ref29.state;
423
+ state = _ref29.state,
424
+ items = _ref29.items;
425
+ var _useState = (0, _react.useState)(false),
426
+ _useState2 = _slicedToArray(_useState, 2),
427
+ displayItems = _useState2[0],
428
+ setDisplayItems = _useState2[1];
407
429
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
408
430
  type: type,
409
431
  state: state
@@ -413,9 +435,29 @@ var OrderRender = function OrderRender(_ref29) {
413
435
  state: state
414
436
  }, /*#__PURE__*/_react.default.createElement(_ShoppingCartOutlined.default, {
415
437
  fontSize: "small"
416
- }), /*#__PURE__*/_react.default.createElement("h5", null, /*#__PURE__*/_react.default.createElement("strong", null, count, " items"))), /*#__PURE__*/_react.default.createElement("div", null, amount, " (estimated total)")), /*#__PURE__*/_react.default.createElement(IntButton, {
438
+ }), /*#__PURE__*/_react.default.createElement("h5", null, /*#__PURE__*/_react.default.createElement("strong", null, count, " items")))), displayItems ? /*#__PURE__*/_react.default.createElement(OrderBody, {
417
439
  state: state
418
- }, "view sent cart")));
440
+ }, items.map(function (data, index) {
441
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(CartContent, {
442
+ state: state
443
+ }, /*#__PURE__*/_react.default.createElement("p", null, index + 1, ". "), /*#__PURE__*/_react.default.createElement(ProductImage, {
444
+ src: data.imgURL,
445
+ alt: "product"
446
+ }), /*#__PURE__*/_react.default.createElement("p", null, data.description, " @ ", data.currency, " ", data.amount)), /*#__PURE__*/_react.default.createElement("hr", {
447
+ style: {
448
+ width: '100%'
449
+ }
450
+ }));
451
+ })) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null), /*#__PURE__*/_react.default.createElement(OrderBody, {
452
+ state: state
453
+ }, /*#__PURE__*/_react.default.createElement(CartContent, {
454
+ state: state
455
+ }, /*#__PURE__*/_react.default.createElement("p", null, amount, " (Estimated Total)"))), /*#__PURE__*/_react.default.createElement(IntButton, {
456
+ state: state,
457
+ onClick: function onClick() {
458
+ setDisplayItems(!displayItems);
459
+ }
460
+ }, /*#__PURE__*/_react.default.createElement("p", null, displayItems ? 'HIDE' : 'SHOW', " CART ITEMS"))));
419
461
  };
420
462
  BmChat.Details = function (_ref30) {
421
463
  var children = _ref30.children,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beem-component",
3
- "version": "2.0.21",
3
+ "version": "2.0.23",
4
4
  "private": false,
5
5
  "main": "dist/components/index.js",
6
6
  "scripts": {
package/src/App.js CHANGED
@@ -106,8 +106,10 @@ const Chat = () => {
106
106
  metadata: {
107
107
  id: '6538d48e-1b17-45e8-8e44-be457d3695c0',
108
108
  prev_message:
109
- '{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3987644271555185","header":{"text":"Our Food Menu"},"body":{"text":"*Terms and Conditions for Delivery* \\n- Though we try our best to deliver your food in time, there might be delays\\n- Prices might differ from the ones on the website \\n- Packing charges will be added on the prices \\n- Minimum delivery order TZS 13,000"},"footer":{"text":"Powered by Beem"},"sections":[{"title":"South Indian","productList":[{"productId":95},{"productId":96},{"productId":97},{"productId":98},{"productId":99},{"productId":100},{"productId":101},{"productId":105}]},{"title":"Soups","productList":[{"productId":102},{"productId":103},{"productId":104}]},{"title":"Paratha","productList":[{"productId":106},{"productId":107},{"productId":108},{"productId":109}]},{"title":"Starters & Chaat","productList":[{"productId":110},{"productId":111}]},{"title":"Extras","productList":[{"productId":112},{"productId":113},{"productId":114}]},{"title":"Thali","productList":[{"productId":115},{"productId":116},{"productId":117},{"productId":118}]}]}}',
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"}]}}',
109
+ // '{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3987644271555185","header":{"text":"Our Food Menu"},"body":{"text":"*Terms and Conditions for Delivery* \\n- Though we try our best to deliver your food in time, there might be delays\\n- Prices might differ from the ones on the website \\n- Packing charges will be added on the prices \\n- Minimum delivery order TZS 13,000"},"footer":{"text":"Powered by Beem"},"sections":[{"title":"South Indian","productList":[{"productId":95},{"productId":96},{"productId":97},{"productId":98},{"productId":99},{"productId":100},{"productId":101},{"productId":105}]},{"title":"Soups","productList":[{"productId":102},{"productId":103},{"productId":104}]},{"title":"Paratha","productList":[{"productId":106},{"productId":107},{"productId":108},{"productId":109}]},{"title":"Starters & Chaat","productList":[{"productId":110},{"productId":111}]},{"title":"Extras","productList":[{"productId":112},{"productId":113},{"productId":114}]},{"title":"Thali","productList":[{"productId":115},{"productId":116},{"productId":117},{"productId":118}]}]}}',
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"}]}}',
111
+ // '{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"","text":"Thank you we have received your order\\n\\n• 1 X 20\\" Zuri Wig Straight Mirna Caramel Brown - USD 505\\n• 1 X 14\\" Zuri Wig Straight Miss Van Platinum Blonde - USD 960\\n• 1 X 18\\" Zuri Wig Straight Miss Van Platinum Blonde - USD 960\\n• 1 X 10\\" Zuri Wig Straight Monroe Platinum Blonde - USD 505\\n\\n\\n*Proceed to payment to complete order process*","caption":""},"options":[{"type":"text","title":"Proceed to payment","postbackText":"option-defined-postback1"},{"type":"text","title":"Main menu","postbackText":"option-defined-postback2"}]}}',
112
+ '{"dotgoV2":{"type":"list","title":"","body":"Hey Abdallah,\\n\\n*Welcome to Zuri House Of Beauty* \\n\\nWe offer a range of styles designed by Black women for Black women. Our platform, brand, and financing solutions promote economic mobility for Black women entrepreneurs. \\n\\nHow can I assist you today?","globalButtons":[{"type":"text","title":"Browse Services"}],"items":[{"title":"Browse Services","subtitle":"","options":[{"type":"text","title":"View Products","description":"","postbackText":"section 1 row 1 postback payload"},{"type":"text","title":"Track Order","description":"Enter order id for status","postbackText":"section 1 row 1 postback payload"},{"type":"text","title":"Support","description":"","postbackText":"section 1 row 1 postback payload"},{"type":"text","title":"Feedback","description":"Give feedback","postbackText":"bm-feedback|0|bf5ff7a3-6425-484e-9b7b-6104ec774bff"},{"type":"text","title":"Ask us anything","description":"","postbackText":"section 1 row 1 postback payload"}]}]}}',
111
113
  },
112
114
  };
113
115
 
@@ -745,6 +747,134 @@ const Chat = () => {
745
747
  // setCheckboxVisibility(updatedVisibility); // Update the state
746
748
  // };
747
749
 
750
+ const renderOrderJsonMessage = () => {
751
+ const parsedMessage = {
752
+ dotgoV2: {
753
+ type: 'order',
754
+ catalog: {
755
+ id: '1828458897997668',
756
+ order: {
757
+ items: [
758
+ {
759
+ id: '147',
760
+ currency: 'USD',
761
+ amount: '960',
762
+ quantity: '1',
763
+ },
764
+ {
765
+ id: '144',
766
+ currency: 'USD',
767
+ amount: '505',
768
+ quantity: '1',
769
+ },
770
+ {
771
+ id: '145',
772
+ currency: 'USD',
773
+ amount: '505',
774
+ quantity: '1',
775
+ },
776
+ {
777
+ id: '148',
778
+ currency: 'USD',
779
+ amount: '505',
780
+ quantity: '1',
781
+ },
782
+ {
783
+ id: '149',
784
+ currency: 'USD',
785
+ amount: '505',
786
+ quantity: '1',
787
+ },
788
+ {
789
+ id: '146',
790
+ currency: 'USD',
791
+ amount: '960',
792
+ quantity: '1',
793
+ },
794
+ ],
795
+ },
796
+ },
797
+ forwarded: false,
798
+ frequently_forwarded: false,
799
+ },
800
+ };
801
+ const dotGoV2Content = parsedMessage?.dotgoV2;
802
+ const items = dotGoV2Content?.catalog?.order?.items || [];
803
+ if (items.length === 0) {
804
+ return { amount: 0, type: 'order', count: 0 };
805
+ }
806
+
807
+ const totalValue = items.reduce((total, item) => {
808
+ return total + item.amount * item.quantity;
809
+ }, 0);
810
+
811
+ const currency = items[0]?.currency || '';
812
+ const count = items.length;
813
+ const formattedTotal = totalValue.toLocaleString('en-US');
814
+
815
+ return {
816
+ amount: `${currency} ${formattedTotal}`,
817
+ type: 'order',
818
+ count,
819
+ items: [
820
+ {
821
+ id: 147,
822
+ currency: 'USD',
823
+ amount: '960',
824
+ quantity: '1',
825
+ description: '18" Zuri Wig Straight Miss Van Platinum Blonde',
826
+ imgURL:
827
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/Miss Van.jpg',
828
+ },
829
+ {
830
+ id: 144,
831
+ currency: 'USD',
832
+ amount: '505',
833
+ quantity: '1',
834
+ description: '10" Zuri Wig Straight Mirna Caramel Brown',
835
+ imgURL:
836
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/Wig Mirna.jpg',
837
+ },
838
+ {
839
+ id: 145,
840
+ currency: 'USD',
841
+ amount: '505',
842
+ quantity: '1',
843
+ description: '20" Zuri Wig Straight Mirna Caramel Brown',
844
+ imgURL:
845
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/Wig Mirna.jpg',
846
+ },
847
+ {
848
+ id: 148,
849
+ currency: 'USD',
850
+ amount: '505',
851
+ quantity: '1',
852
+ description: '10" Zuri Wig Straight Monroe Platinum Blonde',
853
+ imgURL:
854
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/monroe-wig-14.jpg',
855
+ },
856
+ {
857
+ id: 149,
858
+ currency: 'USD',
859
+ amount: '505',
860
+ quantity: '1',
861
+ description: '14" Zuri Wig Straight Monroe Platinum Blonde',
862
+ imgURL:
863
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/monroe-wig-14.jpg',
864
+ },
865
+ {
866
+ id: 146,
867
+ currency: 'USD',
868
+ amount: '960',
869
+ quantity: '1',
870
+ description: '14" Zuri Wig Straight Miss Van Platinum Blonde',
871
+ imgURL:
872
+ 'https://bm-chatbot-images.s3.eu-west-1.amazonaws.com/Miss Van.jpg',
873
+ },
874
+ ],
875
+ };
876
+ };
877
+
748
878
  const renderJsonMessagex = () => {
749
879
  const parsedMessage = JSON.parse(x.metadata.prev_message);
750
880
  const dotGoV2Content = parsedMessage?.dotgoV2;
@@ -765,6 +895,18 @@ const Chat = () => {
765
895
  <GlobalStyle />
766
896
 
767
897
  <div>
898
+ <BmChat.Details
899
+ key={85279}
900
+ state="inbound"
901
+ session="bot"
902
+ displayTime={<p>12:00pm</p>}
903
+ status="sent"
904
+ type="interactive"
905
+ sessionTimeline={{ message: <p>12:00pm</p> }}
906
+ style={{ margin: '-0.6% 0 0 0' }}
907
+ >
908
+ {renderOrderJsonMessage()}
909
+ </BmChat.Details>
768
910
  <BmChat.Details
769
911
  state="outbound"
770
912
  session="bot"
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-nested-ternary */
2
2
  /* eslint-disable react/display-name */
3
- import React from 'react';
3
+ import React, { useState } from 'react';
4
4
  import { Done, DoneAll } from '@material-ui/icons';
5
5
  import FilePresentIcon from '@mui/icons-material/FilePresent';
6
6
  import DownloadIcon from '@mui/icons-material/Download';
@@ -192,6 +192,13 @@ const OrderBody = styled.button`
192
192
  }};
193
193
  }
194
194
  `;
195
+
196
+ const ProductImage = styled.img`
197
+ width: 50px;
198
+ height: 50px;
199
+ border-radius: 50%;
200
+ padding: 5px;
201
+ `;
195
202
  const CartContent = styled.div`
196
203
  margin-bottom: 0.5rem;
197
204
  display: flex;
@@ -434,7 +441,12 @@ const QuickReplyRender = ({
434
441
  )}
435
442
 
436
443
  <strong>{content?.header}</strong>
437
- <p>{content?.text}</p>
444
+ {content?.text?.split('\n').map((line) => (
445
+ <p>
446
+ {line}
447
+ <br />
448
+ </p>
449
+ ))}
438
450
  <small>{content?.caption}</small>
439
451
  {options?.map((button) => (
440
452
  // eslint-disable-next-line react/jsx-key
@@ -470,7 +482,12 @@ const ListReplyRender = ({
470
482
  <>
471
483
  <Messages type={type} state={state} isInteractive={isInteractive}>
472
484
  <strong>{title}</strong>
473
- <p>{body}</p>
485
+ {body.split('\n').map((line) => (
486
+ <p>
487
+ {line}
488
+ <br />
489
+ </p>
490
+ ))}
474
491
  <IntButton state={state}>
475
492
  <ListIcon />
476
493
  {globalButtons[0]?.title}
@@ -480,7 +497,8 @@ const ListReplyRender = ({
480
497
  );
481
498
  };
482
499
 
483
- const OrderRender = ({ count, amount, type, state }) => {
500
+ const OrderRender = ({ count, amount, type, state, items }) => {
501
+ const [displayItems, setDisplayItems] = useState(false);
484
502
  return (
485
503
  <>
486
504
  <Messages type={type} state={state}>
@@ -491,10 +509,40 @@ const OrderRender = ({ count, amount, type, state }) => {
491
509
  <strong>{count} items</strong>
492
510
  </h5>
493
511
  </CartContent>
494
- <div>{amount} (estimated total)</div>
495
512
  </OrderBody>
496
513
 
497
- <IntButton state={state}>view sent cart</IntButton>
514
+ {displayItems ? (
515
+ <OrderBody state={state}>
516
+ {items.map((data, index) => (
517
+ <>
518
+ <CartContent state={state}>
519
+ <p>{index + 1}. </p>
520
+ <ProductImage src={data.imgURL} alt="product" />
521
+
522
+ <p>
523
+ {data.description} @ {data.currency} {data.amount}
524
+ </p>
525
+ </CartContent>
526
+ <hr style={{ width: '100%' }} />
527
+ </>
528
+ ))}
529
+ </OrderBody>
530
+ ) : (
531
+ <></>
532
+ )}
533
+ <OrderBody state={state}>
534
+ <CartContent state={state}>
535
+ <p>{amount} (Estimated Total)</p>
536
+ </CartContent>
537
+ </OrderBody>
538
+ <IntButton
539
+ state={state}
540
+ onClick={() => {
541
+ setDisplayItems(!displayItems);
542
+ }}
543
+ >
544
+ <p>{displayItems ? 'HIDE' : 'SHOW'} CART ITEMS</p>
545
+ </IntButton>
498
546
  </Messages>
499
547
  </>
500
548
  );