beem-component 1.9.1 → 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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.MessageState = exports.BmImageWrapper = exports.BmImageChat = exports.BmImage = void 0;
|
|
6
|
+
exports.default = exports.RepliedTextWrapper = exports.MessageState = exports.BmImageWrapper = exports.BmImageChat = exports.BmImage = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _icons = require("@material-ui/icons");
|
|
9
9
|
var _FilePresent = _interopRequireDefault(require("@mui/icons-material/FilePresent"));
|
|
@@ -18,7 +18,7 @@ var _colors = require("../../colors");
|
|
|
18
18
|
var _FeedPostComments = require("./FeedPostComments");
|
|
19
19
|
var _excluded = ["state", "file", "src", "fileName", "onDownload", "link"],
|
|
20
20
|
_excluded2 = ["state", "src", "fileName"],
|
|
21
|
-
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName"];
|
|
21
|
+
_excluded3 = ["children", "state", "displayTime", "status", "session", "src", "file", "fileName", "sessionDetails", "sessionTimeline", "feedPostComments", "agentName", "metadata"];
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
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); }
|
|
24
24
|
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; }
|
|
@@ -48,8 +48,16 @@ var MessageDetails = _styledComponents.default.div.withConfig({
|
|
|
48
48
|
})(["display:flex;flex-direction:column;max-width:70%;> *{margin-top:0.5rem;margin-bottom:0.5rem;}"]);
|
|
49
49
|
var Messages = _styledComponents.default.div.withConfig({
|
|
50
50
|
displayName: "chatBody__Messages"
|
|
51
|
-
})(["display:flex;flex-direction:row;align-items:center;padding:0.5rem;background:", ";color:", ";border-radius:", ";border:
|
|
52
|
-
var state = _ref2.state
|
|
51
|
+
})(["display:flex;flex-direction:row;align-items:center;padding:1rem 0.5rem;background:", ";color:", ";border-radius:", ";border-left:", ";border:", ";word-break:break-word;margin:0rem;"], function (_ref2) {
|
|
52
|
+
var state = _ref2.state,
|
|
53
|
+
metadata = _ref2.metadata;
|
|
54
|
+
if (metadata) {
|
|
55
|
+
if (state) {
|
|
56
|
+
if (state === 'inbound') return "".concat(_colors.BmTransparentBg30);
|
|
57
|
+
if (state === 'outbound') return "".concat(_colors.BmTransparentBg30);
|
|
58
|
+
}
|
|
59
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
60
|
+
}
|
|
53
61
|
if (state) {
|
|
54
62
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
|
|
55
63
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
|
|
@@ -63,26 +71,47 @@ var Messages = _styledComponents.default.div.withConfig({
|
|
|
63
71
|
}
|
|
64
72
|
return "".concat(_colors.BmPrimaryWhite);
|
|
65
73
|
}, function (_ref4) {
|
|
66
|
-
var state = _ref4.state
|
|
74
|
+
var state = _ref4.state,
|
|
75
|
+
metadata = _ref4.metadata;
|
|
76
|
+
if (metadata) {
|
|
77
|
+
return '0rem';
|
|
78
|
+
}
|
|
67
79
|
if (state) {
|
|
68
80
|
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
69
81
|
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
70
82
|
}
|
|
71
83
|
return "".concat(_colors.BmPrimaryWhite);
|
|
72
|
-
},
|
|
84
|
+
}, function (_ref5) {
|
|
85
|
+
var state = _ref5.state,
|
|
86
|
+
metadata = _ref5.metadata;
|
|
87
|
+
if (metadata) {
|
|
88
|
+
if (state) {
|
|
89
|
+
if (state === 'inbound') return "2px solid ".concat(_colors.BmPrimaryBlue);
|
|
90
|
+
if (state === 'outbound') return "2px solid ".concat(_colors.BmPrimaryGold);
|
|
91
|
+
}
|
|
92
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
93
|
+
}
|
|
94
|
+
return '';
|
|
95
|
+
}, function (_ref6) {
|
|
96
|
+
var metadata = _ref6.metadata;
|
|
97
|
+
if (metadata) {
|
|
98
|
+
return '';
|
|
99
|
+
}
|
|
100
|
+
return "0.071rem solid ".concat(_colors.BmGrey200, ";");
|
|
101
|
+
});
|
|
73
102
|
var MessagesSubDetails = _styledComponents.default.div.withConfig({
|
|
74
103
|
displayName: "chatBody__MessagesSubDetails"
|
|
75
|
-
})(["display:flex;flex-direction:row;align-items:center;> *:not(:last-child){margin-right:0.5rem;}margin-left:", ";margin-top:0.5rem;"], function (
|
|
76
|
-
var state =
|
|
104
|
+
})(["display:flex;flex-direction:row;align-items:center;> *:not(:last-child){margin-right:0.5rem;}margin-left:", ";margin-top:0.5rem;"], function (_ref7) {
|
|
105
|
+
var state = _ref7.state;
|
|
77
106
|
if (state) {
|
|
78
107
|
if (state === 'inbound') return '0px';
|
|
79
108
|
if (state === 'outbound') return 'auto';
|
|
80
109
|
}
|
|
81
110
|
return "".concat(_colors.BmPrimaryWhite);
|
|
82
111
|
});
|
|
83
|
-
var handleState = function handleState(
|
|
84
|
-
var session =
|
|
85
|
-
agentName =
|
|
112
|
+
var handleState = function handleState(_ref8) {
|
|
113
|
+
var session = _ref8.session,
|
|
114
|
+
agentName = _ref8.agentName;
|
|
86
115
|
if (session === 'bot') {
|
|
87
116
|
return /*#__PURE__*/_react.default.createElement(_avatars.default, {
|
|
88
117
|
size: "small",
|
|
@@ -113,29 +142,29 @@ var handleState = function handleState(_ref6) {
|
|
|
113
142
|
// Start of File Attachment
|
|
114
143
|
var FileAttachmentWrapper = _styledComponents.default.div.withConfig({
|
|
115
144
|
displayName: "chatBody__FileAttachmentWrapper"
|
|
116
|
-
})(["display:flex;cursor:pointer;flex-direction:row;padding:1rem;background:", ";color:", ";border-radius:", ";border:0.071rem solid ", ";> *{&:last-child{margin-left:auto;}:not(:last-child){margin-right:0.5rem;}}&&& > *{align-items:center;color:", ";}", " ", ""], function (
|
|
117
|
-
var state =
|
|
145
|
+
})(["display:flex;cursor:pointer;flex-direction:row;padding:1rem;background:", ";color:", ";border-radius:", ";border:0.071rem solid ", ";> *{&:last-child{margin-left:auto;}:not(:last-child){margin-right:0.5rem;}}&&& > *{align-items:center;color:", ";}", " ", ""], function (_ref9) {
|
|
146
|
+
var state = _ref9.state;
|
|
118
147
|
if (state) {
|
|
119
148
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
|
|
120
149
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
|
|
121
150
|
}
|
|
122
151
|
return "".concat(_colors.BmPrimaryWhite);
|
|
123
|
-
}, function (
|
|
124
|
-
var state =
|
|
152
|
+
}, function (_ref10) {
|
|
153
|
+
var state = _ref10.state;
|
|
125
154
|
if (state) {
|
|
126
155
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
127
156
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
128
157
|
}
|
|
129
158
|
return "".concat(_colors.BmPrimaryWhite);
|
|
130
|
-
}, function (
|
|
131
|
-
var state =
|
|
159
|
+
}, function (_ref11) {
|
|
160
|
+
var state = _ref11.state;
|
|
132
161
|
if (state) {
|
|
133
162
|
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
134
163
|
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
135
164
|
}
|
|
136
165
|
return "".concat(_colors.BmPrimaryWhite);
|
|
137
|
-
}, _colors.BmGrey200, function (
|
|
138
|
-
var state =
|
|
166
|
+
}, _colors.BmGrey200, function (_ref12) {
|
|
167
|
+
var state = _ref12.state;
|
|
139
168
|
if (state) {
|
|
140
169
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlue);
|
|
141
170
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
@@ -143,14 +172,14 @@ var FileAttachmentWrapper = _styledComponents.default.div.withConfig({
|
|
|
143
172
|
return "".concat(_colors.BmPrimaryWhite);
|
|
144
173
|
}, '' /* max-width: 100%; */, '' /* max-height: 100%; */);
|
|
145
174
|
|
|
146
|
-
var BmFileAttachment = function BmFileAttachment(
|
|
147
|
-
var state =
|
|
148
|
-
file =
|
|
149
|
-
src =
|
|
150
|
-
fileName =
|
|
151
|
-
onDownload =
|
|
152
|
-
link =
|
|
153
|
-
rest = _objectWithoutProperties(
|
|
175
|
+
var BmFileAttachment = function BmFileAttachment(_ref13) {
|
|
176
|
+
var state = _ref13.state,
|
|
177
|
+
file = _ref13.file,
|
|
178
|
+
src = _ref13.src,
|
|
179
|
+
fileName = _ref13.fileName,
|
|
180
|
+
onDownload = _ref13.onDownload,
|
|
181
|
+
link = _ref13.link,
|
|
182
|
+
rest = _objectWithoutProperties(_ref13, _excluded);
|
|
154
183
|
return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
|
|
155
184
|
state: state
|
|
156
185
|
}, rest), /*#__PURE__*/_react.default.createElement(_iconStyles.BmIcons, {
|
|
@@ -165,15 +194,15 @@ var BmFileAttachment = function BmFileAttachment(_ref11) {
|
|
|
165
194
|
// Start of Component for Images
|
|
166
195
|
var BmImageWrapper = _styledComponents.default.div.withConfig({
|
|
167
196
|
displayName: "chatBody__BmImageWrapper"
|
|
168
|
-
})(["display:flex;flex-direction:column;color:", ";border-radius:", ";border:0.071rem solid ", ";"], function (
|
|
169
|
-
var state =
|
|
197
|
+
})(["display:flex;flex-direction:column;color:", ";border-radius:", ";border:0.071rem solid ", ";"], function (_ref14) {
|
|
198
|
+
var state = _ref14.state;
|
|
170
199
|
if (state) {
|
|
171
200
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
172
201
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
173
202
|
}
|
|
174
203
|
return "".concat(_colors.BmPrimaryWhite);
|
|
175
|
-
}, function (
|
|
176
|
-
var state =
|
|
204
|
+
}, function (_ref15) {
|
|
205
|
+
var state = _ref15.state;
|
|
177
206
|
if (state) {
|
|
178
207
|
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
179
208
|
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
@@ -185,11 +214,11 @@ var BmImage = _styledComponents.default.img.withConfig({
|
|
|
185
214
|
displayName: "chatBody__BmImage"
|
|
186
215
|
})(["", " width:100%;object-fit:cover;flex-grow:1;"], '' /* Fix width */);
|
|
187
216
|
exports.BmImage = BmImage;
|
|
188
|
-
var BmImageChat = function BmImageChat(
|
|
189
|
-
var state =
|
|
190
|
-
src =
|
|
191
|
-
fileName =
|
|
192
|
-
rest = _objectWithoutProperties(
|
|
217
|
+
var BmImageChat = function BmImageChat(_ref16) {
|
|
218
|
+
var state = _ref16.state,
|
|
219
|
+
src = _ref16.src,
|
|
220
|
+
fileName = _ref16.fileName,
|
|
221
|
+
rest = _objectWithoutProperties(_ref16, _excluded2);
|
|
193
222
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BmImageWrapper, _extends({
|
|
194
223
|
state: state
|
|
195
224
|
}, rest), /*#__PURE__*/_react.default.createElement(BmImage, {
|
|
@@ -208,20 +237,39 @@ var MessageState = _styledComponents.default.div.withConfig({
|
|
|
208
237
|
|
|
209
238
|
// End of Component for Images
|
|
210
239
|
exports.MessageState = MessageState;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
240
|
+
var RepliedTextWrapper = _styledComponents.default.div.withConfig({
|
|
241
|
+
displayName: "chatBody__RepliedTextWrapper"
|
|
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) {
|
|
243
|
+
var state = _ref17.state;
|
|
244
|
+
if (state) {
|
|
245
|
+
if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
|
|
246
|
+
if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
|
|
247
|
+
}
|
|
248
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
249
|
+
}, function (_ref18) {
|
|
250
|
+
var state = _ref18.state;
|
|
251
|
+
if (state) {
|
|
252
|
+
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
253
|
+
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
254
|
+
}
|
|
255
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
256
|
+
});
|
|
257
|
+
exports.RepliedTextWrapper = RepliedTextWrapper;
|
|
258
|
+
BmChat.Details = function (_ref19) {
|
|
259
|
+
var children = _ref19.children,
|
|
260
|
+
state = _ref19.state,
|
|
261
|
+
displayTime = _ref19.displayTime,
|
|
262
|
+
status = _ref19.status,
|
|
263
|
+
session = _ref19.session,
|
|
264
|
+
src = _ref19.src,
|
|
265
|
+
file = _ref19.file,
|
|
266
|
+
fileName = _ref19.fileName,
|
|
267
|
+
sessionDetails = _ref19.sessionDetails,
|
|
268
|
+
sessionTimeline = _ref19.sessionTimeline,
|
|
269
|
+
feedPostComments = _ref19.feedPostComments,
|
|
270
|
+
agentName = _ref19.agentName,
|
|
271
|
+
metadata = _ref19.metadata,
|
|
272
|
+
rest = _objectWithoutProperties(_ref19, _excluded3);
|
|
225
273
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Details, _extends({
|
|
226
274
|
state: state
|
|
227
275
|
}, rest), /*#__PURE__*/_react.default.createElement(MessageState, null, state === 'inbound' && session && handleState({
|
|
@@ -234,9 +282,14 @@ BmChat.Details = function (_ref15) {
|
|
|
234
282
|
state: state,
|
|
235
283
|
src: src,
|
|
236
284
|
fileName: fileName
|
|
237
|
-
}, rest)), children && /*#__PURE__*/_react.default.createElement(
|
|
285
|
+
}, rest)), children && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, metadata ? /*#__PURE__*/_react.default.createElement(RepliedTextWrapper, {
|
|
286
|
+
state: state
|
|
287
|
+
}, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
288
|
+
metadata: metadata,
|
|
289
|
+
state: state
|
|
290
|
+
}, metadata), children) : /*#__PURE__*/_react.default.createElement(Messages, {
|
|
238
291
|
state: state
|
|
239
|
-
}, children), file && /*#__PURE__*/_react.default.createElement(BmFileAttachment, _extends({
|
|
292
|
+
}, children)), file && /*#__PURE__*/_react.default.createElement(BmFileAttachment, _extends({
|
|
240
293
|
file: file,
|
|
241
294
|
fileName: fileName,
|
|
242
295
|
state: state
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -1,137 +1,517 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import BmButtonGroup from './lib/components/ButtonGroup/buttonGroup';
|
|
5
|
-
import { BmInputCounter } from './lib/components/InputCounter/inputCounter';
|
|
6
|
-
import BmMultiDateSelector from './lib/components/MultipleDateSelector/multipleDateSelector';
|
|
7
|
-
import BmStepper from './lib/components/Stepper/stepper';
|
|
8
|
-
import {
|
|
9
|
-
BmBgLightBlue,
|
|
10
|
-
// BmGrey200,
|
|
11
|
-
BmGrey400,
|
|
12
|
-
BmGrey50,
|
|
13
|
-
BmPrimaryBlue,
|
|
14
|
-
BmPrimaryGold,
|
|
15
|
-
BmSecondaryGreen,
|
|
16
|
-
BmSecondaryGreen8,
|
|
17
|
-
BmSecondaryPurple,
|
|
18
|
-
BmSecondaryRed,
|
|
19
|
-
} from './lib/components/colors';
|
|
1
|
+
// * eslint-disable func-style *
|
|
2
|
+
/* eslint-disable jsx-a11y/media-has-caption */
|
|
3
|
+
import React from 'react';
|
|
20
4
|
|
|
21
|
-
|
|
22
|
-
const [item, setItem] = useState();
|
|
23
|
-
const Occurance = ['Now', 'Later', 'Recurring'];
|
|
24
|
-
const [count, setCount] = useState();
|
|
25
|
-
const handleCountChange = (newCount) => {
|
|
26
|
-
setCount(newCount);
|
|
27
|
-
};
|
|
28
|
-
const [activeStep, setActiveStep] = useState(new Date().getDay());
|
|
29
|
-
const [selectedDates, setSelectedDates] = useState([]);
|
|
5
|
+
import { BmChat, GlobalStyle } from './lib/components';
|
|
30
6
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
},
|
|
36
213
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
+
},
|
|
40
233
|
},
|
|
41
234
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
+
},
|
|
45
254
|
},
|
|
46
255
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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,
|
|
50
272
|
},
|
|
51
273
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
+
},
|
|
55
293
|
},
|
|
56
294
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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,
|
|
60
311
|
},
|
|
61
312
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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,
|
|
65
329
|
},
|
|
66
330
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
},
|
|
70
494
|
},
|
|
71
495
|
];
|
|
72
|
-
|
|
73
|
-
const statusa = 'rejected';
|
|
74
|
-
|
|
75
|
-
const getStatusValue = (status) => {
|
|
76
|
-
const STATUSES_V2 = {
|
|
77
|
-
pending: BmPrimaryGold,
|
|
78
|
-
inprogress: BmPrimaryBlue,
|
|
79
|
-
'sent-to-mno': BmSecondaryPurple,
|
|
80
|
-
whitelisted: BmBgLightBlue,
|
|
81
|
-
'partial-approved': BmSecondaryGreen8,
|
|
82
|
-
active: BmSecondaryGreen,
|
|
83
|
-
rejected: BmSecondaryRed,
|
|
84
|
-
inactive: BmGrey400,
|
|
85
|
-
};
|
|
86
|
-
return STATUSES_V2[status] || '';
|
|
87
|
-
};
|
|
88
|
-
|
|
89
496
|
return (
|
|
90
497
|
<>
|
|
91
498
|
<GlobalStyle />
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
499
|
+
|
|
500
|
+
<BmChat>
|
|
501
|
+
<BmChat.Body>
|
|
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>
|
|
98
510
|
))}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
min="1"
|
|
102
|
-
max="20"
|
|
103
|
-
count={count}
|
|
104
|
-
onChange={handleCountChange}
|
|
105
|
-
/>
|
|
106
|
-
<BmMultiDateSelector onSelect={handleSelectDates} />
|
|
107
|
-
{selectedDates.length > 0 && (
|
|
108
|
-
<p>Selected dates: {selectedDates.join(', ')}</p>
|
|
109
|
-
)}
|
|
110
|
-
{Weekdays.map(({ dayNo, dayInitial }) => {
|
|
111
|
-
return (
|
|
112
|
-
<BmStepper
|
|
113
|
-
key={dayNo}
|
|
114
|
-
activeStep={activeStep > -1 ? activeStep === dayNo : null}
|
|
115
|
-
onClick={() => {
|
|
116
|
-
setActiveStep(dayNo);
|
|
117
|
-
}}
|
|
118
|
-
>
|
|
119
|
-
{dayInitial}
|
|
120
|
-
</BmStepper>
|
|
121
|
-
);
|
|
122
|
-
})}
|
|
123
|
-
<BmRowLabel disabled>Hello</BmRowLabel>
|
|
124
|
-
<BmTag
|
|
125
|
-
color={getStatusValue(statusa)}
|
|
126
|
-
leadingIcon={<CircleIcon />}
|
|
127
|
-
size="xsmall"
|
|
128
|
-
textColor="black"
|
|
129
|
-
bgColor={BmGrey50}
|
|
130
|
-
>
|
|
131
|
-
<p>Hello</p>
|
|
132
|
-
</BmTag>
|
|
511
|
+
</BmChat.Body>
|
|
512
|
+
</BmChat>
|
|
133
513
|
</>
|
|
134
514
|
);
|
|
135
515
|
};
|
|
136
516
|
|
|
137
|
-
export default
|
|
517
|
+
export default Chat;
|
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
BmPrimaryBlack,
|
|
17
17
|
BmSecondaryDarkGreen,
|
|
18
18
|
BmGrey200,
|
|
19
|
+
BmTransparentBg30,
|
|
20
|
+
BmPrimaryGold,
|
|
19
21
|
} from '../../colors';
|
|
20
22
|
import { BmFeedPostComments } from './FeedPostComments';
|
|
21
23
|
|
|
@@ -71,8 +73,15 @@ const Messages = styled.div`
|
|
|
71
73
|
display: flex;
|
|
72
74
|
flex-direction: row;
|
|
73
75
|
align-items: center;
|
|
74
|
-
padding: 0.5rem;
|
|
75
|
-
background: ${({ state }) => {
|
|
76
|
+
padding: 1rem 0.5rem;
|
|
77
|
+
background: ${({ state, metadata }) => {
|
|
78
|
+
if (metadata) {
|
|
79
|
+
if (state) {
|
|
80
|
+
if (state === 'inbound') return `${BmTransparentBg30}`;
|
|
81
|
+
if (state === 'outbound') return `${BmTransparentBg30}`;
|
|
82
|
+
}
|
|
83
|
+
return `${BmPrimaryWhite}`;
|
|
84
|
+
}
|
|
76
85
|
if (state) {
|
|
77
86
|
if (state === 'inbound') return `${BmPrimaryWhite}`;
|
|
78
87
|
if (state === 'outbound') return `${BmPrimaryBlue}`;
|
|
@@ -86,14 +95,33 @@ const Messages = styled.div`
|
|
|
86
95
|
}
|
|
87
96
|
return `${BmPrimaryWhite}`;
|
|
88
97
|
}};
|
|
89
|
-
border-radius: ${({ state }) => {
|
|
98
|
+
border-radius: ${({ state, metadata }) => {
|
|
99
|
+
if (metadata) {
|
|
100
|
+
return '0rem';
|
|
101
|
+
}
|
|
90
102
|
if (state) {
|
|
91
103
|
if (state === 'inbound') return '0.21875rem 0.21875rem 0.21875rem 0rem';
|
|
92
104
|
if (state === 'outbound') return '0.21875rem 0.21875rem 0rem 0.21875rem';
|
|
93
105
|
}
|
|
94
106
|
return `${BmPrimaryWhite}`;
|
|
95
107
|
}};
|
|
96
|
-
border:
|
|
108
|
+
border-left: ${({ state, metadata }) => {
|
|
109
|
+
if (metadata) {
|
|
110
|
+
if (state) {
|
|
111
|
+
if (state === 'inbound') return `2px solid ${BmPrimaryBlue}`;
|
|
112
|
+
if (state === 'outbound') return `2px solid ${BmPrimaryGold}`;
|
|
113
|
+
}
|
|
114
|
+
return `${BmPrimaryWhite}`;
|
|
115
|
+
}
|
|
116
|
+
return '';
|
|
117
|
+
}};
|
|
118
|
+
|
|
119
|
+
border: ${({ metadata }) => {
|
|
120
|
+
if (metadata) {
|
|
121
|
+
return '';
|
|
122
|
+
}
|
|
123
|
+
return `0.071rem solid ${BmGrey200};`;
|
|
124
|
+
}};
|
|
97
125
|
word-break: break-word;
|
|
98
126
|
margin: 0rem;
|
|
99
127
|
`;
|
|
@@ -254,6 +282,30 @@ export const MessageState = styled.div`
|
|
|
254
282
|
|
|
255
283
|
// End of Component for Images
|
|
256
284
|
|
|
285
|
+
export const RepliedTextWrapper = styled.div`
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
justify-content: center;
|
|
289
|
+
padding: 1.14286rem 1.14286rem 1.14286rem 0.35714rem;
|
|
290
|
+
gap: 1rem;
|
|
291
|
+
border-radius: 0.25rem 0.25rem 0.25rem 0.25rem;
|
|
292
|
+
border: 1px solid ${BmGrey200};
|
|
293
|
+
background: ${({ state }) => {
|
|
294
|
+
if (state) {
|
|
295
|
+
if (state === 'inbound') return `${BmPrimaryWhite}`;
|
|
296
|
+
if (state === 'outbound') return `${BmPrimaryBlue}`;
|
|
297
|
+
}
|
|
298
|
+
return `${BmPrimaryWhite}`;
|
|
299
|
+
}};
|
|
300
|
+
color: ${({ state }) => {
|
|
301
|
+
if (state) {
|
|
302
|
+
if (state === 'inbound') return `${BmPrimaryBlack}`;
|
|
303
|
+
if (state === 'outbound') return `${BmPrimaryWhite}`;
|
|
304
|
+
}
|
|
305
|
+
return `${BmPrimaryWhite}`;
|
|
306
|
+
}};
|
|
307
|
+
`;
|
|
308
|
+
|
|
257
309
|
BmChat.Details = ({
|
|
258
310
|
children,
|
|
259
311
|
state,
|
|
@@ -267,6 +319,7 @@ BmChat.Details = ({
|
|
|
267
319
|
sessionTimeline,
|
|
268
320
|
feedPostComments,
|
|
269
321
|
agentName,
|
|
322
|
+
metadata,
|
|
270
323
|
...rest
|
|
271
324
|
}) => {
|
|
272
325
|
return (
|
|
@@ -289,7 +342,20 @@ BmChat.Details = ({
|
|
|
289
342
|
/>
|
|
290
343
|
)}
|
|
291
344
|
{/* For Messages */}
|
|
292
|
-
{children &&
|
|
345
|
+
{children && (
|
|
346
|
+
<>
|
|
347
|
+
{metadata ? (
|
|
348
|
+
<RepliedTextWrapper state={state}>
|
|
349
|
+
<Messages metadata={metadata} state={state}>
|
|
350
|
+
{metadata}
|
|
351
|
+
</Messages>
|
|
352
|
+
{children}
|
|
353
|
+
</RepliedTextWrapper>
|
|
354
|
+
) : (
|
|
355
|
+
<Messages state={state}>{children}</Messages>
|
|
356
|
+
)}
|
|
357
|
+
</>
|
|
358
|
+
)}
|
|
293
359
|
{/* For files */}
|
|
294
360
|
{file && (
|
|
295
361
|
<BmFileAttachment
|