@paro.io/expert-shared-components 1.12.5 → 1.12.6

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.
@@ -51,7 +51,6 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
51
51
  return uniqueUsers;
52
52
  }, [messages]);
53
53
  const handleSendMessage = () => __awaiter(void 0, void 0, void 0, function* () {
54
- var _a;
55
54
  if (!newMessage.trim())
56
55
  return;
57
56
  try {
@@ -62,7 +61,7 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
62
61
  disputeId,
63
62
  messageText: newMessage,
64
63
  visibility,
65
- senderId: isInternal ? (_a = currentUser === null || currentUser === void 0 ? void 0 : currentUser.app_metadata) === null || _a === void 0 ? void 0 : _a.userId : currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId,
64
+ senderId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId,
66
65
  },
67
66
  },
68
67
  });
@@ -105,19 +104,13 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
105
104
  }
106
105
  };
107
106
  const getMessageAlignment = (userTypeId) => {
108
- // First user in sequence is left-aligned, second is right-aligned
109
- const userIndex = userSequence.indexOf(userTypeId);
110
- return userIndex === 0 ? 'mr-auto' : 'ml-auto';
107
+ return userTypeId !== currentUser.userTypeId ? 'mr-auto' : 'ml-auto';
111
108
  };
112
109
  const getMessageOrder = (userTypeId) => {
113
- // First user in sequence shows avatar on left, second on right
114
- const userIndex = userSequence.indexOf(userTypeId);
115
- return userIndex === 0 ? 'flex-row' : 'flex-row-reverse';
110
+ return userTypeId !== currentUser.userTypeId ? 'flex-row' : 'flex-row-reverse';
116
111
  };
117
112
  const getHeaderAlignment = (userTypeId) => {
118
- // First user in sequence aligns text left, second aligns right
119
- const userIndex = userSequence.indexOf(userTypeId);
120
- return userIndex === 0 ? 'justify-start' : 'justify-end';
113
+ return userTypeId !== currentUser.userTypeId ? 'justify-start' : 'justify-end';
121
114
  };
122
115
  return (react_1.default.createElement("div", { className: "space-y-6" },
123
116
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
@@ -146,7 +139,7 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
146
139
  }, className: "w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0" },
147
140
  react_1.default.createElement("span", { className: "text-sm font-bold" }, getSenderInitial(message.sender))),
148
141
  react_1.default.createElement("div", { className: "flex-1" },
149
- react_1.default.createElement("div", { className: `flex items-center ${getHeaderAlignment(message.sender.userTypeId)} space-x-2` },
142
+ react_1.default.createElement("div", { className: `flex items-center ${getHeaderAlignment(message.sender.userTypeId)} space-x-2 mr-1` },
150
143
  react_1.default.createElement("span", { className: "text-sm font-bold text-[#333333]" },
151
144
  message.sender.firstName,
152
145
  " ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.12.5",
3
+ "version": "1.12.6",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {