@paro.io/expert-shared-components 1.12.40 → 1.12.41

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.
@@ -11,11 +11,12 @@ interface Message {
11
11
  visibility: string;
12
12
  }
13
13
  interface DiscussionSectionProps {
14
- disputeId: string;
14
+ disputeId?: string;
15
+ escalationId?: number;
15
16
  currentUser: any;
16
17
  messages: Message[];
17
18
  onCreateMessage: (variables: any) => Promise<any>;
18
19
  isInternal?: boolean;
19
20
  }
20
- export declare const DiscussionSection: ({ disputeId, currentUser, messages, onCreateMessage, isInternal, }: DiscussionSectionProps) => JSX.Element;
21
+ export declare const DiscussionSection: ({ disputeId, escalationId, currentUser, messages, onCreateMessage, isInternal, }: DiscussionSectionProps) => JSX.Element;
21
22
  export {};
@@ -40,7 +40,7 @@ const react_1 = __importStar(require("react"));
40
40
  const base_ui_1 = require("@paro.io/base-ui");
41
41
  const dayjs_1 = __importDefault(require("dayjs"));
42
42
  const base_icons_1 = require("@paro.io/base-icons");
43
- const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage, isInternal = false, }) => {
43
+ const DiscussionSection = ({ disputeId, escalationId, currentUser, messages, onCreateMessage, isInternal = false, }) => {
44
44
  const [newMessage, setNewMessage] = (0, react_1.useState)('');
45
45
  const [visibility, setVisibility] = (0, react_1.useState)('ALL');
46
46
  const [isLoading, setIsLoading] = (0, react_1.useState)(false);
@@ -55,14 +55,10 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
55
55
  return;
56
56
  try {
57
57
  setIsLoading(true);
58
+ const inputData = Object.assign({ messageText: newMessage, visibility, senderId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId }, (disputeId ? { disputeId } : { escalationId }));
58
59
  yield onCreateMessage({
59
60
  variables: {
60
- input: {
61
- disputeId,
62
- messageText: newMessage,
63
- visibility,
64
- senderId: currentUser === null || currentUser === void 0 ? void 0 : currentUser.userId,
65
- },
61
+ input: inputData,
66
62
  },
67
63
  });
68
64
  setNewMessage('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paro.io/expert-shared-components",
3
- "version": "1.12.40",
3
+ "version": "1.12.41",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {