@paro.io/expert-shared-components 1.11.5 → 1.11.7

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.
Files changed (74) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
  4. package/lib/components/ClientReferencesSection/ParoError.js +10 -10
  5. package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
  6. package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
  7. package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
  8. package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
  9. package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
  10. package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
  11. package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
  12. package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
  13. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  14. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  15. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  16. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  17. package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
  18. package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
  19. package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
  20. package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
  21. package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
  22. package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
  23. package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
  24. package/lib/components/EarningsTracker/EditDateModal.js +149 -149
  25. package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
  26. package/lib/components/EarningsTracker/EmailModal.js +79 -79
  27. package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
  28. package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
  29. package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
  30. package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
  31. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
  32. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
  33. package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
  34. package/lib/components/EarningsTracker/ProgressBar.js +66 -66
  35. package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
  36. package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
  37. package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
  38. package/lib/components/EarningsTracker/RightCardUI.js +231 -231
  39. package/lib/components/EarningsTracker/index.d.ts +1 -1
  40. package/lib/components/EarningsTracker/index.js +5 -5
  41. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  42. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  43. package/lib/components/FileUploader/index.d.ts +4 -2
  44. package/lib/components/FileUploader/index.js +27 -42
  45. package/lib/components/Invoices/DecisionSection.d.ts +0 -1
  46. package/lib/components/Invoices/DecisionSection.js +4 -4
  47. package/lib/components/Invoices/DiscussionSection.d.ts +2 -1
  48. package/lib/components/Invoices/DiscussionSection.js +6 -19
  49. package/lib/components/Invoices/DisputeSection.d.ts +2 -4
  50. package/lib/components/Invoices/DisputeSection.js +32 -18
  51. package/lib/components/Invoices/InvoiceCard.d.ts +3 -4
  52. package/lib/components/Invoices/InvoiceCard.js +6 -6
  53. package/lib/components/Invoices/InvoiceDetails.js +8 -6
  54. package/lib/components/Invoices/InvoiceHeader.js +2 -2
  55. package/lib/components/OrganizationChart/OrganizationChart.d.ts +15 -15
  56. package/lib/components/OrganizationChart/OrganizationChart.js +312 -312
  57. package/lib/components/OrganizationChart/PersonCard.js +5 -5
  58. package/lib/components/OrganizationChart/utils.js +79 -79
  59. package/lib/components/ProjectCard/ProgressBar.js +4 -4
  60. package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
  61. package/lib/components/Reviews/Pagination.js +6 -6
  62. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  63. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  64. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  65. package/lib/components/shared/Image.js +13 -13
  66. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  67. package/lib/components/shared/ProfileTextField.js +16 -16
  68. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  69. package/lib/components/shared/StyledActionButtons.js +15 -15
  70. package/lib/components/shared/ToastNotification.d.ts +10 -10
  71. package/lib/components/shared/ToastNotification.js +63 -63
  72. package/lib/components/shared/UploadClient.d.ts +1 -0
  73. package/lib/components/shared/UploadClient.js +5 -3
  74. package/package.json +61 -61
@@ -15,52 +15,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.fileUploader = void 0;
16
16
  const UploadClient_1 = __importDefault(require("../shared/UploadClient"));
17
17
  const utils_1 = require("../shared/utils");
18
- const CHUNK_SIZE = 5 * 1024 * 1024;
19
- const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, documentName, disputeId, projectId, documentUploadUrl, uploadExpertClientDisputeFilesData, }) {
20
- var _b;
21
- const fileExtension = file.name.split('.').pop() || '';
22
- const fileNameWithExtension = `${documentName}.${fileExtension}`;
23
- const isLargeFile = file.size >= CHUNK_SIZE;
18
+ const fileUploader = (_a) => __awaiter(void 0, [_a], void 0, function* ({ file, projectId, documentUploadUrl, updateClientInvoiceDisputeMutation, disputeId, previousFiles, isExpert, }) {
24
19
  try {
25
- // Read file as base64
26
- const fileForUpload = yield new Promise((resolve, reject) => {
27
- const reader = new FileReader();
28
- reader.onload = () => { var _a; return resolve(((_a = reader.result) === null || _a === void 0 ? void 0 : _a.toString()) || ''); };
29
- reader.onerror = reject;
30
- reader.readAsDataURL(file);
20
+ (0, utils_1.showToast)('success', 'Starting Document Upload');
21
+ const uploadClient = new UploadClient_1.default({
22
+ fileSelected: file,
23
+ fileName: file.name,
24
+ projectId,
25
+ documentUploadUrl,
26
+ bucketName: 'expert-client-dispute-files',
31
27
  });
32
- // Upload large file via multipart
33
- if (isLargeFile) {
34
- (0, utils_1.showToast)('warning', 'Uploading a large file this may take longer than usual. Thank you for your patience!');
35
- const uploadClient = new UploadClient_1.default({
36
- fileSelected: file,
37
- fileName: fileNameWithExtension,
38
- projectId,
39
- documentUploadUrl,
28
+ yield uploadClient.triggerMultipartUpload().then((res) => {
29
+ const resParsed = JSON.parse(res);
30
+ const documentLink = resParsed === null || resParsed === void 0 ? void 0 : resParsed.Location;
31
+ updateClientInvoiceDisputeMutation({
32
+ variables: {
33
+ input: {
34
+ disputeId: disputeId,
35
+ projectDisputes: [
36
+ Object.assign({ projectId: projectId }, (isExpert ? {
37
+ expertDocumentLinks: [...previousFiles, documentLink].join(',')
38
+ } : {
39
+ clientDocumentLinks: [...previousFiles, documentLink].join(',')
40
+ }))
41
+ ]
42
+ },
43
+ },
40
44
  });
41
- yield uploadClient.triggerMultipartUpload();
42
- }
43
- const inputData = {
44
- disputeId: disputeId ? disputeId : projectId, // initially we don't have disputeId. clarify and update
45
- fileName: documentName,
46
- data: isLargeFile ? '' : fileForUpload,
47
- fileSize: file.size,
48
- };
49
- console.log({ inputData, disputeId, projectId });
50
- // Upload metadata to backend
51
- const response = yield uploadExpertClientDisputeFilesData({
52
- variables: {
53
- input: inputData,
54
- },
45
+ console.log(`Multipart File uploaded successfully with ${res}`);
46
+ (0, utils_1.showToast)('success', 'Document Upload Successful');
55
47
  });
56
- if ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.uploadExpertClientDisputeFilesData) {
57
- (0, utils_1.showToast)('success', 'Supporting document uploaded successfully!');
58
- return true;
59
- }
60
- else {
61
- (0, utils_1.showToast)('warning', 'Failed to upload supporting document');
62
- return false;
63
- }
48
+ return true;
64
49
  }
65
50
  catch (error) {
66
51
  (0, utils_1.showToast)('warning', 'Error uploading file. Please try again.');
@@ -1,7 +1,6 @@
1
1
  interface DecisionSectionProps {
2
2
  dispute: any;
3
3
  onUpdateDispute: (variables: any) => Promise<any>;
4
- onRefetch: () => Promise<void>;
5
4
  }
6
5
  export declare const DecisionSection: ({ dispute, onUpdateDispute, }: DecisionSectionProps) => JSX.Element;
7
6
  export {};
@@ -40,9 +40,9 @@ const react_1 = __importStar(require("react"));
40
40
  const base_ui_1 = require("@paro.io/base-ui");
41
41
  const react_hot_toast_1 = __importDefault(require("react-hot-toast"));
42
42
  const RESOLUTION_OPTIONS = [
43
- { value: 'Resolved', label: 'Approve Dispute' },
44
- { value: 'Resolved', label: 'Decline Dispute' },
45
- { value: 'Resolved', label: 'Partial Approval' },
43
+ { value: 'APPROVED', label: 'Approve Dispute' },
44
+ { value: 'DECLINED', label: 'Decline Dispute' },
45
+ { value: 'PARTIAL', label: 'Partial Approval' },
46
46
  ];
47
47
  const DecisionSection = ({ dispute, onUpdateDispute, }) => {
48
48
  const [resolution, setResolution] = (0, react_1.useState)('');
@@ -57,7 +57,7 @@ const DecisionSection = ({ dispute, onUpdateDispute, }) => {
57
57
  variables: {
58
58
  input: {
59
59
  disputeId: dispute.disputeId,
60
- status: resolution,
60
+ status: "Resolved",
61
61
  approvedAmount: amount ? parseFloat(amount) : undefined,
62
62
  },
63
63
  },
@@ -14,6 +14,7 @@ interface DiscussionSectionProps {
14
14
  currentUser: any;
15
15
  messages: Message[];
16
16
  onCreateMessage: (variables: any) => Promise<any>;
17
+ isInternal?: boolean;
17
18
  }
18
- export declare const DiscussionSection: ({ disputeId, currentUser, messages, onCreateMessage, }: DiscussionSectionProps) => JSX.Element;
19
+ export declare const DiscussionSection: ({ disputeId, currentUser, messages, onCreateMessage, isInternal }: DiscussionSectionProps) => JSX.Element;
19
20
  export {};
@@ -39,24 +39,11 @@ exports.DiscussionSection = void 0;
39
39
  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
- const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage, }) => {
43
- var _a;
42
+ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage, isInternal }) => {
44
43
  const [newMessage, setNewMessage] = (0, react_1.useState)('');
45
44
  const [visibility, setVisibility] = (0, react_1.useState)('ALL');
46
45
  const [isLoading, setIsLoading] = (0, react_1.useState)(false);
47
46
  const threadsEndRef = (0, react_1.useRef)(null);
48
- const didMountRef = (0, react_1.useRef)(false);
49
- // Auto scroll to bottom when messages change
50
- (0, react_1.useEffect)(() => {
51
- if (didMountRef.current) {
52
- if (threadsEndRef.current) {
53
- threadsEndRef.current.scrollIntoView({ behavior: "smooth" });
54
- }
55
- }
56
- else {
57
- didMountRef.current = true;
58
- }
59
- }, [messages]);
60
47
  // Get the sequence of unique userTypeIds to determine alignment
61
48
  const userSequence = (0, react_1.useMemo)(() => {
62
49
  const uniqueUsers = Array.from(new Set(messages.map(m => m.sender.userTypeId)));
@@ -95,11 +82,11 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
95
82
  const getSenderTextColor = (userTypeId) => {
96
83
  switch (userTypeId) {
97
84
  case 1:
98
- return '#195C5C';
85
+ return '#643E0C';
99
86
  case 2:
100
87
  return '#2196F3';
101
88
  case 3:
102
- return '#643E0C';
89
+ return '#195C5C';
103
90
  default:
104
91
  return '#333333';
105
92
  }
@@ -107,11 +94,11 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
107
94
  const getSenderBackgroundColor = (userTypeId) => {
108
95
  switch (userTypeId) {
109
96
  case 1:
110
- return '#D9EFEF';
97
+ return '#FDD7A5';
111
98
  case 2:
112
99
  return '#E4F0FF';
113
100
  case 3:
114
- return '#FDD7A5';
101
+ return '#D9EFEF';
115
102
  default:
116
103
  return '#F8F9FA';
117
104
  }
@@ -157,7 +144,7 @@ const DiscussionSection = ({ disputeId, currentUser, messages, onCreateMessage,
157
144
  react_1.default.createElement("div", { className: "font-bold text-[#333333] mb-2" }, "Add Comment"),
158
145
  react_1.default.createElement("textarea", { value: newMessage, onChange: (e) => setNewMessage(e.target.value), placeholder: "Type your comment here...", className: "w-full h-24 p-3 border border-[#CCCCCC] rounded-lg text-sm resize-none focus:outline-none focus:ring-2 focus:ring-[#248384]" })),
159
146
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
160
- react_1.default.createElement("div", { className: "flex items-center space-x-4" }, ((_a = currentUser === null || currentUser === void 0 ? void 0 : currentUser.app_metadata) === null || _a === void 0 ? void 0 : _a.userTypeId) === 1 && (react_1.default.createElement(react_1.default.Fragment, null,
147
+ react_1.default.createElement("div", { className: "flex items-center space-x-4" }, isInternal && (react_1.default.createElement(react_1.default.Fragment, null,
161
148
  react_1.default.createElement("span", { className: "text-sm text-[#666666]" }, "Visible to:"),
162
149
  react_1.default.createElement("div", { className: "flex items-center space-x-2" },
163
150
  react_1.default.createElement("label", { className: "flex items-center space-x-2 cursor-pointer" },
@@ -1,9 +1,7 @@
1
1
  interface DisputeSectionProps {
2
2
  dispute: any;
3
- onUpdateDispute: (variables: any) => Promise<any>;
4
- onRefetch: () => Promise<void>;
5
3
  documentUploadUrl: string;
6
- uploadExpertClientDisputeFiles: (variables: any) => Promise<any>;
4
+ updateClientInvoiceDisputeMutation: (variables: any) => Promise<any>;
7
5
  }
8
- export declare const DisputeSection: ({ dispute, onUpdateDispute, onRefetch, documentUploadUrl, uploadExpertClientDisputeFiles, }: DisputeSectionProps) => JSX.Element;
6
+ export declare const DisputeSection: ({ dispute, documentUploadUrl, updateClientInvoiceDisputeMutation, }: DisputeSectionProps) => JSX.Element;
9
7
  export {};
@@ -37,6 +37,7 @@ const react_1 = __importStar(require("react"));
37
37
  const base_ui_1 = require("@paro.io/base-ui");
38
38
  const base_icons_1 = require("@paro.io/base-icons");
39
39
  const FileUploader_1 = require("../FileUploader");
40
+ const core_1 = require("@material-ui/core");
40
41
  const ACCEPTED_FILE_TYPES = [
41
42
  'application/pdf',
42
43
  'application/msword',
@@ -45,20 +46,19 @@ const ACCEPTED_FILE_TYPES = [
45
46
  'image/png',
46
47
  'text/csv',
47
48
  ];
48
- const DisputeSection = ({ dispute, onUpdateDispute, onRefetch, documentUploadUrl, uploadExpertClientDisputeFiles, }) => {
49
+ const DisputeSection = ({ dispute, documentUploadUrl, updateClientInvoiceDisputeMutation, }) => {
49
50
  var _a, _b, _c;
50
- const [files, setFiles] = (0, react_1.useState)((dispute === null || dispute === void 0 ? void 0 : dispute.clientDocumentLinks) || []);
51
51
  const fileInputRef = (0, react_1.useRef)(null);
52
+ const disputeProject = (_a = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _a === void 0 ? void 0 : _a[0];
53
+ const clientDocumentLinks = (_b = disputeProject === null || disputeProject === void 0 ? void 0 : disputeProject.clientDocumentLinks) === null || _b === void 0 ? void 0 : _b.split(',');
54
+ const expertDocumentLinks = (_c = disputeProject === null || disputeProject === void 0 ? void 0 : disputeProject.expertDocumentLinks) === null || _c === void 0 ? void 0 : _c.split(',');
52
55
  const validateFileUpload = (file) => {
53
56
  return ACCEPTED_FILE_TYPES.includes(file.type);
54
57
  };
55
- const handleUpload = (event) => {
58
+ const handleUpload = (event, isExpert) => {
56
59
  const selectedFiles = event.target.files;
57
60
  if (!selectedFiles)
58
61
  return;
59
- const validFiles = Array.from(selectedFiles)
60
- .filter(file => validateFileUpload(file))
61
- .map(file => file.name);
62
62
  const getFileNames = selectedFiles && Array.from(selectedFiles).map((file) => {
63
63
  if (!validateFileUpload(file)) {
64
64
  return null;
@@ -77,21 +77,19 @@ const DisputeSection = ({ dispute, onUpdateDispute, onRefetch, documentUploadUrl
77
77
  documentName: selectedFile.name,
78
78
  projectId: Number((_b = (_a = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.projectId),
79
79
  documentUploadUrl: documentUploadUrl,
80
- uploadExpertClientDisputeFilesData: uploadExpertClientDisputeFiles,
80
+ updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation,
81
+ disputeId: dispute === null || dispute === void 0 ? void 0 : dispute.disputeId,
82
+ previousFiles: isExpert ? expertDocumentLinks : clientDocumentLinks,
83
+ isExpert: isExpert,
81
84
  });
82
85
  });
83
86
  reader.readAsDataURL(selectedFile);
84
87
  });
85
- setFiles(prev => [...prev, ...validFiles]);
86
88
  }
87
89
  if (fileInputRef.current) {
88
90
  fileInputRef.current.value = '';
89
91
  }
90
92
  };
91
- const handleRemoveFile = (fileName) => {
92
- setFiles(prev => prev.filter(f => f !== fileName));
93
- };
94
- const disputeProject = (_a = dispute === null || dispute === void 0 ? void 0 : dispute.disputeProjects) === null || _a === void 0 ? void 0 : _a[0];
95
93
  return (react_1.default.createElement("div", { className: "grid grid-cols-2 gap-6" },
96
94
  react_1.default.createElement("div", { className: "space-y-4" },
97
95
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
@@ -106,9 +104,17 @@ const DisputeSection = ({ dispute, onUpdateDispute, onRefetch, documentUploadUrl
106
104
  react_1.default.createElement("div", null,
107
105
  react_1.default.createElement("div", { className: "text-sm font-bold text-[#333333] mb-2" }, "Supporting Documents:"),
108
106
  react_1.default.createElement("div", { className: "flex flex-wrap gap-2" },
109
- react_1.default.createElement("input", { ref: fileInputRef, type: "file", multiple: true, accept: ACCEPTED_FILE_TYPES.join(','), className: "hidden", onChange: handleUpload }),
110
- react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]" }), (_b = disputeProject === null || disputeProject === void 0 ? void 0 : disputeProject.clientDocumentLinks) === null || _b === void 0 ? void 0 :
111
- _b.map((file, index) => (react_1.default.createElement(base_ui_1.Tag, { key: index, label: file, variant: "subtle", color: "success", iconRight: react_1.default.createElement(base_icons_1.IconXCircle, null), onClick: () => handleRemoveFile(file) }))))))),
107
+ react_1.default.createElement("input", { ref: fileInputRef, type: "file", multiple: true, accept: ACCEPTED_FILE_TYPES.join(','), className: "hidden", onChange: (e) => handleUpload(e, false) }),
108
+ react_1.default.createElement("div", { className: "flex flex-wrap gap-2" }, expertDocumentLinks === null || expertDocumentLinks === void 0 ? void 0 : expertDocumentLinks.map((file, index) => (
109
+ // @ts-ignore
110
+ react_1.default.createElement(core_1.Chip, { key: index, label: file.split('%2F').pop(), variant: "outlined", onClick: () => { window.open(file, '_blank'); }, sx: {
111
+ '&:hover': {
112
+ cursor: 'pointer',
113
+ backgroundColor: 'rgba(76, 175, 80, 0.1)'
114
+ }
115
+ } })))),
116
+ react_1.default.createElement("div", { className: "w-full mt-2" },
117
+ react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]" })))))),
112
118
  react_1.default.createElement("div", { className: "space-y-4" },
113
119
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
114
120
  react_1.default.createElement("div", { className: "text-lg font-bold text-[#333333]" }, "Expert Rebuttal")),
@@ -119,8 +125,16 @@ const DisputeSection = ({ dispute, onUpdateDispute, onRefetch, documentUploadUrl
119
125
  react_1.default.createElement("div", null,
120
126
  react_1.default.createElement("div", { className: "text-sm font-bold text-[#333333] mb-2" }, "Supporting Documents:"),
121
127
  react_1.default.createElement("div", { className: "flex flex-wrap gap-2" },
122
- react_1.default.createElement("input", { ref: fileInputRef, type: "file", multiple: true, accept: ACCEPTED_FILE_TYPES.join(','), className: "hidden", onChange: handleUpload }),
123
- react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]" }), (_c = disputeProject === null || disputeProject === void 0 ? void 0 : disputeProject.expertDocumentLinks) === null || _c === void 0 ? void 0 :
124
- _c.map((file, index) => (react_1.default.createElement(base_ui_1.Tag, { key: index, label: file, variant: "subtle", color: "success", iconRight: react_1.default.createElement(base_icons_1.IconXCircle, null), onClick: () => handleRemoveFile(file) })))))))));
128
+ react_1.default.createElement("input", { ref: fileInputRef, type: "file", multiple: true, accept: ACCEPTED_FILE_TYPES.join(','), className: "hidden", onChange: (e) => handleUpload(e, true) }),
129
+ react_1.default.createElement("div", { className: "flex flex-wrap gap-2" }, clientDocumentLinks === null || clientDocumentLinks === void 0 ? void 0 : clientDocumentLinks.map((file, index) => (
130
+ // @ts-ignore
131
+ react_1.default.createElement(core_1.Chip, { key: index, label: file.split('%2F').pop(), variant: "outlined", onClick: () => { window.open(file, '_blank'); }, sx: {
132
+ '&:hover': {
133
+ cursor: 'pointer',
134
+ backgroundColor: 'rgba(76, 175, 80, 0.1)'
135
+ }
136
+ } })))),
137
+ react_1.default.createElement("div", { className: "w-full mt-2" },
138
+ react_1.default.createElement(base_ui_1.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: "sm" }), onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, size: "sm", color: "info", className: "bg-white border border-[#248384] text-[#248384]" }))))))));
125
139
  };
126
140
  exports.DisputeSection = DisputeSection;
@@ -3,10 +3,9 @@ interface InvoiceCardProps {
3
3
  createDisputeChatMessage: any;
4
4
  user: any;
5
5
  chatMessages: any[];
6
- updateClientInvoiceMutation: any;
7
- refetchInvoiceDisputes: any;
6
+ updateClientInvoiceDisputeMutation: any;
8
7
  documentUploadUrl: string;
9
- uploadExpertClientDisputeFiles: any;
8
+ isInternal?: boolean;
10
9
  }
11
- export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceMutation, refetchInvoiceDisputes, documentUploadUrl, uploadExpertClientDisputeFiles, }: InvoiceCardProps) => JSX.Element;
10
+ export declare const InvoiceCard: ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, isInternal }: InvoiceCardProps) => JSX.Element;
12
11
  export {};
@@ -11,15 +11,15 @@ const InvoiceDetails_1 = require("./InvoiceDetails");
11
11
  const DisputeSection_1 = require("./DisputeSection");
12
12
  const DiscussionSection_1 = require("./DiscussionSection");
13
13
  const DecisionSection_1 = require("./DecisionSection");
14
- const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceMutation, refetchInvoiceDisputes, documentUploadUrl, uploadExpertClientDisputeFiles, }) => {
15
- var _a, _b, _c;
14
+ const InvoiceCard = ({ clientInvoice, createDisputeChatMessage, user, chatMessages, updateClientInvoiceDisputeMutation, documentUploadUrl, isInternal }) => {
15
+ var _a, _b;
16
16
  return (react_1.default.createElement(base_ui_1.Card, { className: "w-full bg-white rounded-lg shadow-sm overflow-hidden" },
17
17
  react_1.default.createElement(InvoiceHeader_1.InvoiceHeader, { invoice: clientInvoice }),
18
18
  react_1.default.createElement("div", { className: "p-6 space-y-6" },
19
19
  react_1.default.createElement(InvoiceDetails_1.InvoiceDetails, { invoice: clientInvoice }),
20
- react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceMutation, onRefetch: refetchInvoiceDisputes, documentUploadUrl: documentUploadUrl, uploadExpertClientDisputeFiles: uploadExpertClientDisputeFiles }),
21
- (clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.chatEnabled) && (react_1.default.createElement(DiscussionSection_1.DiscussionSection, { disputeId: (_b = (_a = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id, currentUser: user, messages: chatMessages, onCreateMessage: createDisputeChatMessage })),
22
- ((_c = user === null || user === void 0 ? void 0 : user.app_metadata) === null || _c === void 0 ? void 0 : _c.userTypeId) === 2 &&
23
- react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceMutation, onRefetch: refetchInvoiceDisputes }))));
20
+ react_1.default.createElement(DisputeSection_1.DisputeSection, { dispute: clientInvoice, documentUploadUrl: documentUploadUrl, updateClientInvoiceDisputeMutation: updateClientInvoiceDisputeMutation }),
21
+ (clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.chatEnabled) && (react_1.default.createElement(DiscussionSection_1.DiscussionSection, { disputeId: (_b = (_a = clientInvoice === null || clientInvoice === void 0 ? void 0 : clientInvoice.disputeProjects) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id, currentUser: user, messages: chatMessages, onCreateMessage: createDisputeChatMessage, isInternal: isInternal })),
22
+ isInternal &&
23
+ react_1.default.createElement(DecisionSection_1.DecisionSection, { dispute: clientInvoice, onUpdateDispute: updateClientInvoiceDisputeMutation }))));
24
24
  };
25
25
  exports.InvoiceCard = InvoiceCard;
@@ -5,29 +5,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.InvoiceDetails = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
- const base_ui_1 = require("@paro.io/base-ui");
9
8
  const dayjs_1 = __importDefault(require("dayjs"));
10
9
  const DisputeProjectCard_1 = require("./DisputeProjectCard");
10
+ const core_1 = require("@material-ui/core");
11
11
  const InvoiceDetails = ({ invoice }) => {
12
12
  var _a;
13
13
  const getStatusColor = (status) => {
14
14
  switch (status) {
15
15
  case 'InProgress':
16
- return 'warning';
16
+ return 'primary';
17
17
  case 'UnderReview':
18
- return 'info';
18
+ return 'primary';
19
19
  case 'Resolved':
20
20
  return 'success';
21
21
  default:
22
- return 'default';
22
+ return 'primary';
23
23
  }
24
24
  };
25
25
  return (react_1.default.createElement("div", { className: "space-y-6" },
26
26
  react_1.default.createElement("div", { className: "flex items-center space-x-4" },
27
- react_1.default.createElement(base_ui_1.Tag, { label: invoice === null || invoice === void 0 ? void 0 : invoice.status, variant: "subtle", color: getStatusColor(invoice === null || invoice === void 0 ? void 0 : invoice.status) }),
27
+ react_1.default.createElement(core_1.Chip, { label: invoice === null || invoice === void 0 ? void 0 : invoice.status, size: "small", variant: "outlined",
28
+ // @ts-ignore
29
+ color: getStatusColor(invoice === null || invoice === void 0 ? void 0 : invoice.status) }),
28
30
  react_1.default.createElement("span", { className: "text-xs text-[#666666]" },
29
31
  "Last updated: ",
30
- (0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeUpdatedDate).format('MM-DD-YYYY'))),
32
+ (0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeUpdatedDate).format('MMM D, YYYY'))),
31
33
  ((_a = invoice === null || invoice === void 0 ? void 0 : invoice.disputeProjects) === null || _a === void 0 ? void 0 : _a.length) > 0 && (react_1.default.createElement("div", { className: "space-y-4" },
32
34
  react_1.default.createElement("div", { className: "grid grid-cols-1 gap-4" }, invoice.disputeProjects.map((project) => (react_1.default.createElement(DisputeProjectCard_1.DisputeProjectCard, { key: project.id, project: project, client: invoice === null || invoice === void 0 ? void 0 : invoice.client, disputeDate: invoice === null || invoice === void 0 ? void 0 : invoice.disputeDate, disputeUpdatedDate: invoice === null || invoice === void 0 ? void 0 : invoice.disputeUpdatedDate }))))))));
33
35
  };
@@ -15,10 +15,10 @@ const InvoiceHeader = ({ invoice }) => {
15
15
  react_1.default.createElement("span", { className: "ml-2" }, (_a = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _a === void 0 ? void 0 : _a.id)),
16
16
  react_1.default.createElement("div", null,
17
17
  react_1.default.createElement("span", { className: "text-sm font-bold" }, "Dispute Date: "),
18
- react_1.default.createElement("span", { className: "ml-2" }, (0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeDate).format('MM-DD-YYYY'))),
18
+ react_1.default.createElement("span", { className: "ml-2" }, (0, dayjs_1.default)(invoice === null || invoice === void 0 ? void 0 : invoice.disputeDate).format('MMM D, YYYY'))),
19
19
  react_1.default.createElement("div", null,
20
20
  react_1.default.createElement("span", { className: "text-sm font-bold" }, "Invoice Date: "),
21
- react_1.default.createElement("span", { className: "ml-2" }, (0, dayjs_1.default)((_b = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _b === void 0 ? void 0 : _b.dateGenerated).format('MM-DD-YYYY')))),
21
+ react_1.default.createElement("span", { className: "ml-2" }, (0, dayjs_1.default)((_b = invoice === null || invoice === void 0 ? void 0 : invoice.invoice) === null || _b === void 0 ? void 0 : _b.dateGenerated).format('MMM D, YYYY')))),
22
22
  react_1.default.createElement("div", null,
23
23
  react_1.default.createElement("span", { className: "text-sm font-bold" }, "Expert Name: "),
24
24
  react_1.default.createElement("span", { className: "ml-2" }, (_c = invoice === null || invoice === void 0 ? void 0 : invoice.freelancer) === null || _c === void 0 ? void 0 :
@@ -1,15 +1,15 @@
1
- interface OrgChartProps {
2
- openModal: boolean;
3
- setOpenModal: (openModal: boolean) => void;
4
- expertFirms: any;
5
- firstName: string;
6
- lastName: string;
7
- imageUrl?: string;
8
- primaryServiceLine: string;
9
- city: string;
10
- stateAbbreviation: string;
11
- paroTenure?: string;
12
- isPublicProfile?: boolean;
13
- }
14
- export declare const OrganizationChart: ({ openModal, setOpenModal, expertFirms, firstName, lastName, imageUrl, primaryServiceLine, city, stateAbbreviation, paroTenure, isPublicProfile }: OrgChartProps) => JSX.Element;
15
- export {};
1
+ interface OrgChartProps {
2
+ openModal: boolean;
3
+ setOpenModal: (openModal: boolean) => void;
4
+ expertFirms: any;
5
+ firstName: string;
6
+ lastName: string;
7
+ imageUrl?: string;
8
+ primaryServiceLine: string;
9
+ city: string;
10
+ stateAbbreviation: string;
11
+ paroTenure?: string;
12
+ isPublicProfile?: boolean;
13
+ }
14
+ export declare const OrganizationChart: ({ openModal, setOpenModal, expertFirms, firstName, lastName, imageUrl, primaryServiceLine, city, stateAbbreviation, paroTenure, isPublicProfile }: OrgChartProps) => JSX.Element;
15
+ export {};