@paro.io/expert-shared-components 1.14.8 → 1.14.10

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/DiscussionThread/chat.d.ts +22 -22
  14. package/lib/components/DiscussionThread/chat.js +106 -106
  15. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  16. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  17. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  18. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  19. package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
  20. package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
  21. package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
  22. package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
  23. package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
  24. package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
  25. package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
  26. package/lib/components/EarningsTracker/EditDateModal.js +149 -149
  27. package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
  28. package/lib/components/EarningsTracker/EmailModal.js +79 -79
  29. package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
  30. package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
  31. package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
  32. package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
  33. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
  34. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
  35. package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
  36. package/lib/components/EarningsTracker/ProgressBar.js +66 -66
  37. package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
  38. package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
  39. package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
  40. package/lib/components/EarningsTracker/RightCardUI.js +231 -231
  41. package/lib/components/EarningsTracker/index.d.ts +1 -1
  42. package/lib/components/EarningsTracker/index.js +5 -5
  43. package/lib/components/Escalations/CustomTag.d.ts +3 -3
  44. package/lib/components/Escalations/CustomTag.js +25 -25
  45. package/lib/components/Escalations/ViewReponseModal.d.ts +8 -8
  46. package/lib/components/Escalations/ViewReponseModal.js +27 -27
  47. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  48. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  49. package/lib/components/Invoices/TestDecisionSection.d.ts +1 -1
  50. package/lib/components/Invoices/TestDecisionSection.js +126 -126
  51. package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
  52. package/lib/components/OrganizationChart/PersonCard.js +5 -5
  53. package/lib/components/OrganizationChart/utils.js +79 -79
  54. package/lib/components/ProjectCard/ProgressBar.js +4 -4
  55. package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
  56. package/lib/components/ProjectIntelligence/EngagementHeader/index.js +5 -1
  57. package/lib/components/ProjectIntelligence/FocusAreas/index.d.ts +1 -1
  58. package/lib/components/ProjectIntelligence/FocusAreas/index.js +6 -7
  59. package/lib/components/ProjectIntelligence/MissingInformation/index.d.ts +1 -1
  60. package/lib/components/ProjectIntelligence/MissingInformation/index.js +3 -3
  61. package/lib/components/ProjectIntelligence/index.d.ts +3 -2
  62. package/lib/components/ProjectIntelligence/index.js +119 -87
  63. package/lib/components/Reviews/Pagination.js +6 -6
  64. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  65. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  66. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  67. package/lib/components/shared/Image.js +13 -13
  68. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  69. package/lib/components/shared/ProfileTextField.js +16 -16
  70. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  71. package/lib/components/shared/StyledActionButtons.js +15 -15
  72. package/lib/components/shared/ToastNotification.d.ts +10 -10
  73. package/lib/components/shared/ToastNotification.js +63 -63
  74. package/package.json +67 -67
@@ -25,7 +25,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.FocusAreas = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
- const date_fns_1 = require("date-fns");
29
28
  const utils_1 = require("../../shared/utils");
30
29
  const STATUS_COLORS = {
31
30
  CONFIRMED: 'bg-blue-100 text-blue-800 border-blue-200',
@@ -45,7 +44,7 @@ const PRIORITY_COLORS = {
45
44
  LOW: 'text-green-600',
46
45
  };
47
46
  // Modal Component
48
- const EditFocusAreaModal = ({ isOpen, focusArea, onClose, onSave, updateOpportunityFocusArea, GetOpportunityInsightsDocument, selectedOpportunityId, onSaveFocusArea, }) => {
47
+ const EditFocusAreaModal = ({ isOpen, focusArea, onClose, onSave, updateOpportunityFocusArea, GetOpportunityInsightsDocument, selectedOpportunityId, onSaveMessage, }) => {
49
48
  const [title, setTitle] = (0, react_1.useState)((focusArea === null || focusArea === void 0 ? void 0 : focusArea.title) || '');
50
49
  const [description, setDescription] = (0, react_1.useState)((focusArea === null || focusArea === void 0 ? void 0 : focusArea.description) || '');
51
50
  react_1.default.useEffect(() => {
@@ -69,7 +68,7 @@ const EditFocusAreaModal = ({ isOpen, focusArea, onClose, onSave, updateOpportun
69
68
  ]
70
69
  });
71
70
  (0, utils_1.showToast)('success', 'Focus area updated successfully');
72
- onSaveFocusArea && onSaveFocusArea();
71
+ onSaveMessage && onSaveMessage('Focus area updated successfully');
73
72
  }
74
73
  catch (error) {
75
74
  console.error('Error updating focus area:', error);
@@ -104,7 +103,7 @@ const EditFocusAreaModal = ({ isOpen, focusArea, onClose, onSave, updateOpportun
104
103
  react_1.default.createElement("button", { onClick: handleCancel, className: "px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 border border-gray-300 rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 transition-colors" }, "Cancel"),
105
104
  react_1.default.createElement("button", { onClick: handleSave, className: "px-4 py-2 text-sm font-medium text-white bg-blue bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors" }, "Save")))));
106
105
  };
107
- const FocusAreas = ({ focusAreas, updateOpportunityFocusArea, GetOpportunityInsightsDocument, selectedOpportunityId, onSaveFocusArea, }) => {
106
+ const FocusAreas = ({ focusAreas, updateOpportunityFocusArea, GetOpportunityInsightsDocument, selectedOpportunityId, onSaveMessage, }) => {
108
107
  const [editingFocusArea, setEditingFocusArea] = (0, react_1.useState)(null);
109
108
  const [isModalOpen, setIsModalOpen] = (0, react_1.useState)(false);
110
109
  const [localFocusAreas, setLocalFocusAreas] = (0, react_1.useState)(focusAreas || []);
@@ -144,7 +143,7 @@ const FocusAreas = ({ focusAreas, updateOpportunityFocusArea, GetOpportunityInsi
144
143
  setLocalFocusAreas(prev => prev.map(area => area.id === focusArea.id
145
144
  ? Object.assign(Object.assign({}, area), { status: newStatus }) : area));
146
145
  (0, utils_1.showToast)('success', `Focus area marked as ${newStatus.toLowerCase()}`);
147
- onSaveFocusArea && onSaveFocusArea();
146
+ onSaveMessage && onSaveMessage(`Focus area marked as ${newStatus.toLowerCase()}`);
148
147
  }
149
148
  catch (error) {
150
149
  console.error('Error updating focus area status:', error);
@@ -180,11 +179,11 @@ const FocusAreas = ({ focusAreas, updateOpportunityFocusArea, GetOpportunityInsi
180
179
  react_1.default.createElement("span", null, "Edit Focus Area")))),
181
180
  react_1.default.createElement("p", { className: "text-sm text-gray-600 mb-2" }, area.description),
182
181
  react_1.default.createElement("div", { className: "flex items-center space-x-4 text-xs text-gray-500" },
183
- react_1.default.createElement("span", null, (0, date_fns_1.format)(new Date(area.dueDate), 'MMM dd, yyyy')),
182
+ react_1.default.createElement("span", null, area.dueDate),
184
183
  react_1.default.createElement("span", { className: `font-medium ${PRIORITY_COLORS[area.priority]}` },
185
184
  area.priority,
186
185
  " Priority"),
187
186
  area.status === 'IN_PROGRESS' && (react_1.default.createElement("span", { className: "text-blue-600" }, "In progress")))))))))),
188
- react_1.default.createElement(EditFocusAreaModal, { isOpen: isModalOpen, focusArea: editingFocusArea, onClose: handleCloseModal, onSave: handleSaveFocusArea, selectedOpportunityId: selectedOpportunityId, updateOpportunityFocusArea: updateOpportunityFocusArea, GetOpportunityInsightsDocument: GetOpportunityInsightsDocument, onSaveFocusArea: onSaveFocusArea })));
187
+ react_1.default.createElement(EditFocusAreaModal, { isOpen: isModalOpen, focusArea: editingFocusArea, onClose: handleCloseModal, onSave: handleSaveFocusArea, selectedOpportunityId: selectedOpportunityId, updateOpportunityFocusArea: updateOpportunityFocusArea, GetOpportunityInsightsDocument: GetOpportunityInsightsDocument, onSaveMessage: onSaveMessage })));
189
188
  };
190
189
  exports.FocusAreas = FocusAreas;
@@ -19,7 +19,7 @@ interface MissingInformationProps {
19
19
  } | null;
20
20
  isInternal: boolean;
21
21
  handleRouteToDocuments?: () => void;
22
- onSaveMissingInformation?: any;
22
+ onSaveMessage?: any;
23
23
  isParoIntelligenceRolePresent: boolean;
24
24
  }
25
25
  export declare const MissingInformation: React.FC<MissingInformationProps>;
@@ -164,12 +164,12 @@ const RequestInfoModal = ({ isOpen, missingInfoItem, onClose, onSubmit, document
164
164
  react_1.default.createElement("select", { id: "priorityLevel", disabled: isInternal && !isParoIntelligenceRolePresent, value: priorityLevel, onChange: (e) => { var _a; return setPriorityLevel((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value); }, className: "w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm" }, PRIORITY_LEVELS.map((level) => (react_1.default.createElement("option", { key: level, value: level }, level))))),
165
165
  react_1.default.createElement("div", null,
166
166
  react_1.default.createElement("label", { htmlFor: "specificInformation", className: "block text-sm font-medium text-gray-700 mb-1" }, "Specific Information Needed"),
167
- react_1.default.createElement("textarea", { id: "specificInformation", disabled: isInternal && !isParoIntelligenceRolePresent, value: specificInformation, onChange: (e) => { var _a; return setSpecificInformation((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value); }, rows: 4, className: "w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm", placeholder: "Need NetSuite configuration details:\r\n \r\n 1. US vs Colombian entity setup\r\n 2. Consolidation process and requirements" }))),
167
+ react_1.default.createElement("textarea", { id: "specificInformation", disabled: isInternal && !isParoIntelligenceRolePresent, value: specificInformation, onChange: (e) => { var _a; return setSpecificInformation((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value); }, rows: 4, className: "w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm", placeholder: "Need NetSuite configuration details:\n \n 1. US vs Colombian entity setup\n 2. Consolidation process and requirements" }))),
168
168
  react_1.default.createElement("div", { className: "px-6 py-4 border-t border-gray-200 flex justify-end space-x-3" },
169
169
  react_1.default.createElement("button", { onClick: handleCancel, className: "px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-500 transition-colors" }, "Cancel"),
170
170
  react_1.default.createElement("button", { onClick: handleSubmit, disabled: isInternal && !isParoIntelligenceRolePresent, className: `px-4 py-2 text-sm font-medium text-white bg-blue bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors cursor-${isInternal && !isParoIntelligenceRolePresent ? "not-allowed" : "pointer"}` }, buttonText)))));
171
171
  };
172
- const MissingInformation = ({ items, className = '', opportunityId, GetOpportunityInsightsDocument, updateOpportunityMissingInformation, documentCenterController, isInternal, handleRouteToDocuments, onSaveMissingInformation, isParoIntelligenceRolePresent, }) => {
172
+ const MissingInformation = ({ items, className = '', opportunityId, GetOpportunityInsightsDocument, updateOpportunityMissingInformation, documentCenterController, isInternal, handleRouteToDocuments, onSaveMessage, isParoIntelligenceRolePresent, }) => {
173
173
  const [selectedItem, setSelectedItem] = (0, react_1.useState)(null);
174
174
  const [isModalOpen, setIsModalOpen] = (0, react_1.useState)(false);
175
175
  const [requestedItems, setRequestedItems] = (0, react_1.useState)({});
@@ -201,7 +201,7 @@ const MissingInformation = ({ items, className = '', opportunityId, GetOpportuni
201
201
  ]
202
202
  });
203
203
  (0, utils_1.showToast)('success', 'Information request submitted successfully');
204
- onSaveMissingInformation && onSaveMissingInformation();
204
+ onSaveMessage && onSaveMessage('Information request submitted successfully');
205
205
  // Update local state to reflect the change immediately
206
206
  setRequestedItems(prev => (Object.assign(Object.assign({}, prev), { [selectedItem.id]: true })));
207
207
  console.log('Information request submitted successfully');
@@ -12,9 +12,10 @@ interface ProjectIntelligenceProps {
12
12
  updateOpportunityFocusArea: any;
13
13
  isInternal?: boolean;
14
14
  handleRouteToDocuments?: () => void;
15
- onSaveFocusArea?: any;
16
- onSaveMissingInformation?: any;
15
+ onSaveMessage?: any;
17
16
  isParoIntelligenceRolePresent?: boolean;
17
+ updateOpportunityPhase?: any;
18
+ getOpportunityInsights?: any;
18
19
  }
19
20
  export declare const ProjectIntelligence: React.FC<ProjectIntelligenceProps>;
20
21
  export {};
@@ -32,15 +32,107 @@ const TeamSection_1 = require("./TeamSection");
32
32
  const ProjectHealth_1 = require("./ProjectHealth");
33
33
  const KeyMetrics_1 = require("./KeyMetrics");
34
34
  const MissingInformation_1 = require("./MissingInformation");
35
- const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityInsightsData, selectedOpportunityId, setSelectedOpportunityId, GetOpportunityInsightsDocument, updateOpportunityMissingInformation, documentCenterController = null, updateOpportunityFocusArea, isInternal = false, handleRouteToDocuments, onSaveFocusArea, onSaveMissingInformation, isParoIntelligenceRolePresent = false, }) => {
35
+ const utils_1 = require("../shared/utils");
36
+ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityInsightsData, selectedOpportunityId, setSelectedOpportunityId, GetOpportunityInsightsDocument, updateOpportunityMissingInformation, documentCenterController = null, updateOpportunityFocusArea, isInternal = false, handleRouteToDocuments, onSaveMessage, isParoIntelligenceRolePresent = false, updateOpportunityPhase, getOpportunityInsights, }) => {
36
37
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
37
38
  const [isLoading, setIsLoading] = (0, react_1.useState)(false);
38
39
  const [currentPhase, setCurrentPhase] = (0, react_1.useState)('Setup');
39
40
  const [nextStageData, setNextStageData] = (0, react_1.useState)(null);
41
+ const [isPolling, setIsPolling] = (0, react_1.useState)(false);
42
+ const [expectedNextPhase, setExpectedNextPhase] = (0, react_1.useState)(null);
43
+ const pollingIntervalRef = (0, react_1.useRef)(null);
44
+ const pollingCountRef = (0, react_1.useRef)(0);
40
45
  const opportunityInsights = opportunityInsightsData === null || opportunityInsightsData === void 0 ? void 0 : opportunityInsightsData.getOpportunityInsights;
41
46
  (0, react_1.useEffect)(() => {
42
47
  setCurrentPhase((opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.phase) || 'In_Progress');
43
48
  }, [opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.phase]);
49
+ // Determine the next phase based on the current phase
50
+ const getNextPhase = (phase) => {
51
+ switch (phase) {
52
+ case 'PreKickoff':
53
+ return 'Kickoff';
54
+ case 'Kickoff':
55
+ return 'Setup';
56
+ case 'Setup':
57
+ return 'Active';
58
+ case 'Active':
59
+ return 'Renewal';
60
+ default:
61
+ return 'Active'; // Default to Active if phase is unknown
62
+ }
63
+ };
64
+ // Polling effect for phase updates
65
+ (0, react_1.useEffect)(() => {
66
+ if (pollingIntervalRef.current) {
67
+ clearInterval(pollingIntervalRef.current);
68
+ pollingIntervalRef.current = null;
69
+ }
70
+ if (isPolling && selectedOpportunityId && getOpportunityInsights && expectedNextPhase) {
71
+ console.log('Starting polling for phase updates:', {
72
+ opportunityId: selectedOpportunityId,
73
+ expectedPhase: expectedNextPhase
74
+ });
75
+ // Immediately make an initial query
76
+ getOpportunityInsights({
77
+ variables: { opportunityId: selectedOpportunityId },
78
+ fetchPolicy: 'network-only',
79
+ }).then((result) => {
80
+ var _a, _b;
81
+ const fetchedPhase = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.getOpportunityInsights) === null || _b === void 0 ? void 0 : _b.phase;
82
+ console.log('Initial poll result:', { fetchedPhase, expectedPhase: expectedNextPhase });
83
+ if (fetchedPhase === expectedNextPhase) {
84
+ setIsPolling(false);
85
+ pollingCountRef.current = 0;
86
+ setExpectedNextPhase(null);
87
+ (0, utils_1.showToast)('success', `Project phase updated to ${fetchedPhase}`);
88
+ onSaveMessage && onSaveMessage('Project phase updated to ' + fetchedPhase);
89
+ return;
90
+ }
91
+ });
92
+ pollingIntervalRef.current = setInterval(() => {
93
+ pollingCountRef.current += 1;
94
+ console.log('Polling iteration:', pollingCountRef.current);
95
+ getOpportunityInsights({
96
+ variables: { opportunityId: selectedOpportunityId },
97
+ fetchPolicy: 'network-only',
98
+ }).then((result) => {
99
+ var _a, _b;
100
+ const fetchedPhase = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.getOpportunityInsights) === null || _b === void 0 ? void 0 : _b.phase;
101
+ console.log('Poll result:', { fetchedPhase, expectedPhase: expectedNextPhase });
102
+ if (fetchedPhase === expectedNextPhase) {
103
+ if (pollingIntervalRef.current) {
104
+ clearInterval(pollingIntervalRef.current);
105
+ pollingIntervalRef.current = null;
106
+ }
107
+ setIsPolling(false);
108
+ pollingCountRef.current = 0;
109
+ setExpectedNextPhase(null);
110
+ (0, utils_1.showToast)('success', `Project phase updated to ${fetchedPhase}`);
111
+ onSaveMessage && onSaveMessage('Project phase updated to ' + fetchedPhase);
112
+ }
113
+ if (pollingCountRef.current >= 12) {
114
+ if (pollingIntervalRef.current) {
115
+ clearInterval(pollingIntervalRef.current);
116
+ pollingIntervalRef.current = null;
117
+ }
118
+ setIsPolling(false);
119
+ pollingCountRef.current = 0;
120
+ setExpectedNextPhase(null);
121
+ (0, utils_1.showToast)('warning', 'Phase calculation is taking longer than expected. The page will update automatically when complete.');
122
+ onSaveMessage && onSaveMessage('Phase calculation is taking longer than expected. The page will update automatically when complete.');
123
+ }
124
+ }).catch((error) => {
125
+ console.error('Error polling for opportunity insights:', error);
126
+ });
127
+ }, 5000);
128
+ return () => {
129
+ if (pollingIntervalRef.current) {
130
+ clearInterval(pollingIntervalRef.current);
131
+ pollingIntervalRef.current = null;
132
+ }
133
+ };
134
+ }
135
+ }, [isPolling, selectedOpportunityId, getOpportunityInsights, expectedNextPhase]);
44
136
  // Create client tabs from checkIfOpportunityInsightsExistData
45
137
  const clientTabs = ((_a = checkIfOpportunityInsightsExistData === null || checkIfOpportunityInsightsExistData === void 0 ? void 0 : checkIfOpportunityInsightsExistData.checkIfOpportunityInsightsExist) === null || _a === void 0 ? void 0 : _a.map((insight) => ({
46
138
  id: insight.opportunityId,
@@ -128,76 +220,26 @@ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityI
128
220
  // Handle moving to the next stage
129
221
  const handleMoveToNextStage = () => {
130
222
  setIsLoading(true);
131
- // Create next stage data with financial focus areas and carry over missing information
132
- const nextStageFocusAreas = [
133
- {
134
- id: 'next-focus-1',
135
- title: 'Clean up prior accounting periods',
136
- description: 'Review and bring the company\'s books up-to-date for all prior accounting periods before the project start date. This includes entering invoices, applying payments, entering bills, categorizing transactions, and reconciling accounts test',
137
- status: 'CONFIRMED',
138
- dueDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(), // 7 days from now
139
- priority: 'HIGH'
140
- },
141
- {
142
- id: 'next-focus-2',
143
- title: 'Ongoing bookkeeping and accounting',
144
- description: 'Provide monthly bookkeeping and accounting support including invoice entry, payment processing, bill entry, transaction categorization, account reconciliations, and reporting package delivery.',
145
- status: 'CONFIRMED',
146
- dueDate: new Date(Date.now() + 14 * 24 * 60 * 60 * 1000).toISOString(), // 14 days from now
147
- priority: 'MEDIUM'
148
- },
149
- {
150
- id: 'next-focus-3',
151
- title: 'Transition to new accounting system',
152
- description: 'Assist in preparing the books and migrating data to the company\'s new front-end accounting system once implemented.',
153
- status: 'CONFIRMED',
154
- dueDate: new Date(Date.now() + 10 * 24 * 60 * 60 * 1000).toISOString(), // 10 days from now
155
- priority: 'HIGH'
156
- }
157
- ];
158
- // Carry over missing information that doesn't have CLIENT_RESPONDED status
159
- const carriedOverMissingInfo = (opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.missingInformation)
160
- ? opportunityInsights.missingInformation
161
- .filter((item) => (item === null || item === void 0 ? void 0 : item.status) !== 'CLIENT_RESPONDED')
162
- .map((item, index) => (Object.assign(Object.assign({}, item), { id: `carried-${item.id || index}` })))
163
- : [];
164
- // Add new missing information items
165
- const newMissingInfo = [
166
- {
167
- id: 'new-missing-1',
168
- title: 'Financial Transaction History',
169
- description: 'Need access to the last 6 months of financial transaction history for the project',
170
- priority: 'HIGH',
171
- category: 'Financial',
172
- status: 'PENDING'
173
- },
174
- {
175
- id: 'new-missing-2',
176
- title: 'Budget Approval Documentation',
177
- description: 'Require documentation showing approval of the current budget allocation',
178
- priority: 'MEDIUM',
179
- category: 'Documentation',
180
- status: 'PENDING'
181
- },
182
- {
183
- id: 'new-missing-3',
184
- title: 'Financial Stakeholder Contact Information',
185
- description: 'Need contact details for all financial stakeholders involved in the project',
186
- priority: 'LOW',
187
- category: 'Contact',
188
- status: 'PENDING'
223
+ // Calculate what the next phase should be
224
+ const nextPhase = getNextPhase(currentPhase);
225
+ setExpectedNextPhase(nextPhase);
226
+ updateOpportunityPhase({
227
+ variables: {
228
+ opportunityId: selectedOpportunityId
189
229
  }
190
- ];
191
- // Set the next stage data
192
- setNextStageData({
193
- focusAreas: nextStageFocusAreas,
194
- missingInformation: [...carriedOverMissingInfo, ...newMissingInfo]
195
- });
196
- // Simulate loading and then update the UI
197
- setTimeout(() => {
198
- setCurrentPhase('Active');
230
+ }).then(() => {
231
+ setIsLoading(false);
232
+ // Start polling for phase updates
233
+ setIsPolling(true);
234
+ pollingCountRef.current = 0;
235
+ }).catch((error) => {
199
236
  setIsLoading(false);
200
- }, 3000);
237
+ setIsPolling(false);
238
+ setExpectedNextPhase(null);
239
+ console.error('Error updating opportunity phase:', error);
240
+ (0, utils_1.showToast)('warning', 'Error updating opportunity phase. Please try again.');
241
+ onSaveMessage && onSaveMessage('Error updating opportunity phase. Please try again.');
242
+ });
201
243
  };
202
244
  const hasNoProjectIntelligence = !(checkIfOpportunityInsightsExistData === null || checkIfOpportunityInsightsExistData === void 0 ? void 0 : checkIfOpportunityInsightsExistData.checkIfOpportunityInsightsExist) ||
203
245
  checkIfOpportunityInsightsExistData.checkIfOpportunityInsightsExist.length === 0;
@@ -234,23 +276,13 @@ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityI
234
276
  clientResponse: (item === null || item === void 0 ? void 0 : item.clientResponse) || undefined
235
277
  })) : [];
236
278
  };
237
- // Get the current phase and next steps text based on the current phase
238
- const getPhaseInfo = () => {
239
- if (currentPhase === 'Kickoff') {
240
- return {
241
- phaseDisplay: 'Kickoff Phase (Day 1 of 3)',
242
- nextSteps: 'System access & team introductions'
243
- };
244
- }
245
- else {
246
- return {
247
- phaseDisplay: 'Preparation Phase',
248
- nextSteps: 'Complete initial focus areas'
249
- };
250
- }
251
- };
252
- const phaseInfo = getPhaseInfo();
253
279
  return (react_1.default.createElement(react_1.default.Fragment, null,
280
+ isPolling && (react_1.default.createElement("div", { className: "fixed top-4 right-4 bg-white shadow-lg rounded-md p-4 z-50 w-80" },
281
+ react_1.default.createElement("div", { className: "flex items-center mb-2" },
282
+ react_1.default.createElement("div", { className: "animate-spin rounded-full h-5 w-5 border-t-2 border-b-2 border-blue-500 mr-3" }),
283
+ react_1.default.createElement("span", { className: "font-medium" }, "Calculating next phase insights")),
284
+ react_1.default.createElement("div", { className: "w-full bg-gray-200 rounded-full h-2.5" },
285
+ react_1.default.createElement("div", { className: "bg-blue-600 h-2.5 rounded-full transition-all duration-500 ease-out", style: { width: `${Math.min((pollingCountRef.current / 12) * 100, 100)}%` } })))),
254
286
  react_1.default.createElement("div", { className: "mx-auto px-4 py-8" },
255
287
  react_1.default.createElement(EngagementHeader_1.EngagementHeader, { clientName: (opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.opportunityName) || '', expertName: ((_b = opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.expertInfo) === null || _b === void 0 ? void 0 : _b.name) || '', expertTitle: ((_c = opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.expertInfo) === null || _c === void 0 ? void 0 : _c.role) || '', startDate: (opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.startDate) || '', status: currentPhase || (opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.phase) || 'In_Progress', clientTabs: clientTabs, selectedClientId: selectedOpportunityId, onClientChange: handleClientChange, allFocusAreasCompleted: areAllFocusAreasCompleted(), onMoveToNextStage: handleMoveToNextStage, isLoading: isLoading }),
256
288
  react_1.default.createElement(ProgressTracker_1.ProgressTracker, { percentage: 0, currentPhase: currentPhase }),
@@ -259,7 +291,7 @@ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityI
259
291
  react_1.default.createElement("div", { className: "animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-blue-500 mx-auto mb-4" }),
260
292
  react_1.default.createElement("p", { className: "text-lg font-medium text-gray-700" }, "Calculating Intelligence for your next Stage")))) : (react_1.default.createElement("div", { className: "flex flex-row space-x-4 mt-8" },
261
293
  react_1.default.createElement("div", { className: "w-2/3 space-7-4" },
262
- react_1.default.createElement(FocusAreas_1.FocusAreas, { focusAreas: convertFocusAreas(), onEditFocusAreas: () => { }, updateOpportunityFocusArea: updateOpportunityFocusArea, GetOpportunityInsightsDocument: GetOpportunityInsightsDocument, selectedOpportunityId: selectedOpportunityId, onSaveFocusArea: onSaveFocusArea }),
294
+ react_1.default.createElement(FocusAreas_1.FocusAreas, { focusAreas: convertFocusAreas(), onEditFocusAreas: () => { }, updateOpportunityFocusArea: updateOpportunityFocusArea, GetOpportunityInsightsDocument: GetOpportunityInsightsDocument, selectedOpportunityId: selectedOpportunityId, onSaveMessage: onSaveMessage }),
263
295
  react_1.default.createElement(ProjectHealth_1.ProjectHealth, { healthData: {
264
296
  communicationFlow: {
265
297
  status: mapHealthStatus((_e = (_d = opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.opportunityHealth) === null || _d === void 0 ? void 0 : _d.communicationFlow) === null || _e === void 0 ? void 0 : _e.status),
@@ -278,7 +310,7 @@ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityI
278
310
  description: ((_u = (_t = opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.opportunityHealth) === null || _t === void 0 ? void 0 : _t.riskManagement) === null || _u === void 0 ? void 0 : _u.description) || 'N/A'
279
311
  }
280
312
  }, className: "mt-8" }),
281
- react_1.default.createElement(MissingInformation_1.MissingInformation, { items: getMissingInformationItems(), className: "mt-8", opportunityId: selectedOpportunityId, GetOpportunityInsightsDocument: GetOpportunityInsightsDocument, updateOpportunityMissingInformation: updateOpportunityMissingInformation, documentCenterController: documentCenterController, isInternal: isInternal, handleRouteToDocuments: handleRouteToDocuments, onSaveMissingInformation: onSaveMissingInformation, isParoIntelligenceRolePresent: isParoIntelligenceRolePresent })),
313
+ react_1.default.createElement(MissingInformation_1.MissingInformation, { items: getMissingInformationItems(), className: "mt-8", opportunityId: selectedOpportunityId, GetOpportunityInsightsDocument: GetOpportunityInsightsDocument, updateOpportunityMissingInformation: updateOpportunityMissingInformation, documentCenterController: documentCenterController, isInternal: isInternal, handleRouteToDocuments: handleRouteToDocuments, onSaveMessage: onSaveMessage, isParoIntelligenceRolePresent: isParoIntelligenceRolePresent })),
282
314
  react_1.default.createElement("div", { className: "w-1/3 space-y-4" },
283
315
  react_1.default.createElement(TeamSection_1.TeamSection, { clientTeam: opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.clientTeam, expert: {
284
316
  id: 'expert-1',
@@ -51,12 +51,12 @@ const Pagination = ({ total, currentPage = 1, setCurrentPage, perPageItems = 10,
51
51
  };
52
52
  const numberOfPages = Math.ceil(total / perPageItems);
53
53
  return (react_1.default.createElement("div", { className: "bg-white px-4 py-3 border-t border-gray-200 sm:px-6 flex flex-col md:flex-row md:items-center md:justify-between" },
54
- react_1.default.createElement("div", { className: "pb-2 md:pb-0" }, `Showing
55
- ${perPageItems * (currentPage - 1) + 1}
56
- to
57
- ${Math.min(total, perPageItems * currentPage)}
58
- of
59
- ${total}
54
+ react_1.default.createElement("div", { className: "pb-2 md:pb-0" }, `Showing
55
+ ${perPageItems * (currentPage - 1) + 1}
56
+ to
57
+ ${Math.min(total, perPageItems * currentPage)}
58
+ of
59
+ ${total}
60
60
  ${displayText}`),
61
61
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
62
62
  react_1.default.createElement("div", { className: "flex-1 flex justify-between sm:hidden" },
@@ -51,12 +51,12 @@ const isRatingExists = (rating) => {
51
51
  return false;
52
52
  };
53
53
  exports.isRatingExists = isRatingExists;
54
- const StyledButton = (0, styled_components_1.default)(core_2.Button) `
55
- margin: 0px !important;
56
- padding: 26px 0 18px 0 !important;
57
- span {
58
- color: #248384 !important
59
- }
54
+ const StyledButton = (0, styled_components_1.default)(core_2.Button) `
55
+ margin: 0px !important;
56
+ padding: 26px 0 18px 0 !important;
57
+ span {
58
+ color: #248384 !important
59
+ }
60
60
  `;
61
61
  const RatingHeader = ({ ratings, project, index, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, projectIdToShow, }) => {
62
62
  var _a, _b, _c, _d;
@@ -1,20 +1,20 @@
1
- {
2
- "folders": [
3
- {
4
- "path": "../../.."
5
- },
6
- {
7
- "path": "../../../../internal-profile-app"
8
- },
9
- {
10
- "path": "../../../../availability-gantt-chart"
11
- },
12
- {
13
- "path": "../../../../client-portal"
14
- },
15
- {
16
- "path": "../../../../expert-portal"
17
- }
18
- ],
19
- "settings": {}
20
- }
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "../../.."
5
+ },
6
+ {
7
+ "path": "../../../../internal-profile-app"
8
+ },
9
+ {
10
+ "path": "../../../../availability-gantt-chart"
11
+ },
12
+ {
13
+ "path": "../../../../client-portal"
14
+ },
15
+ {
16
+ "path": "../../../../expert-portal"
17
+ }
18
+ ],
19
+ "settings": {}
20
+ }
@@ -34,11 +34,11 @@ const react_hot_toast_1 = __importDefault(require("react-hot-toast"));
34
34
  const ReviewRequestModal = ({ project, requestModal, setRequestModal, expertName, freelancerId, setRequestStatus, selectedProject, setSelectedProject, clientId, refetchParoProjects, setHighlightedRatings, createOrUpdateRatingRequestMutation, getParoProjectsDocument, }) => {
35
35
  var _a;
36
36
  const [showError, setShowError] = (0, react_1.useState)(false);
37
- const [textareaValue, setTextareaValue] = (0, react_1.useState)(`Hi ${(_a = project === null || project === void 0 ? void 0 : project.client) === null || _a === void 0 ? void 0 : _a.name},
38
- I hope you are satisfied with the work I provided on ${project === null || project === void 0 ? void 0 : project.name}. Your feedback is very important to me and helps me improve my services and build my reputation on Paro. Could you please take a moment to leave a review of you experience? Your input is greatly appreciated!
39
-
40
- Thank you in advance for your time and feedback.
41
- Best regards,
37
+ const [textareaValue, setTextareaValue] = (0, react_1.useState)(`Hi ${(_a = project === null || project === void 0 ? void 0 : project.client) === null || _a === void 0 ? void 0 : _a.name},
38
+ I hope you are satisfied with the work I provided on ${project === null || project === void 0 ? void 0 : project.name}. Your feedback is very important to me and helps me improve my services and build my reputation on Paro. Could you please take a moment to leave a review of you experience? Your input is greatly appreciated!
39
+
40
+ Thank you in advance for your time and feedback.
41
+ Best regards,
42
42
  ${expertName}`);
43
43
  const handleTextArea = (e) => {
44
44
  setTextareaValue(e.target.value);
@@ -31,20 +31,20 @@ const react_1 = __importStar(require("react"));
31
31
  const core_1 = require("@material-ui/core");
32
32
  const styled_components_1 = __importDefault(require("styled-components"));
33
33
  const cdn_1 = require("./constants/cdn");
34
- const ProfilePhotoPreview = styled_components_1.default.img `
35
- height: 86px;
36
- width: 86px;
37
- border: 4px solid #F8FAFC;
38
- border-radius: 10px;
39
- object-fit: cover;
40
- object-position: top;
34
+ const ProfilePhotoPreview = styled_components_1.default.img `
35
+ height: 86px;
36
+ width: 86px;
37
+ border: 4px solid #F8FAFC;
38
+ border-radius: 10px;
39
+ object-fit: cover;
40
+ object-position: top;
41
41
  `;
42
- const PhotoChangeButton = (0, styled_components_1.default)(core_1.Typography) `
43
- text-decoration: underline;
44
- cursor: pointer;
45
- :active {
46
- text-decoration: none !important;
47
- }
42
+ const PhotoChangeButton = (0, styled_components_1.default)(core_1.Typography) `
43
+ text-decoration: underline;
44
+ cursor: pointer;
45
+ :active {
46
+ text-decoration: none !important;
47
+ }
48
48
  `;
49
49
  exports.defaultAvatar = cdn_1.CDN_URL + 'defaultAvatar.png';
50
50
  const Image = ({ imageUrl, getUserDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, legacyFreelancerId, }) => {
@@ -1,18 +1,18 @@
1
- import { FieldError } from 'react-hook-form/dist/types/form';
2
- type SectionContents = {
3
- defaultValue?: string | number;
4
- error?: boolean;
5
- helperText: string | undefined | (FieldError | undefined)[];
6
- inputRef?: ((instance: any) => void) | null | undefined;
7
- label?: string;
8
- multiline?: boolean;
9
- name?: string;
10
- placeholder?: string;
11
- props?: unknown;
12
- size?: 'small' | 'medium' | undefined;
13
- onChange?: ((value: any) => void) | undefined;
14
- width?: boolean;
15
- InputProps?: any;
16
- };
17
- declare const ProfileTextField: ({ defaultValue, error, helperText, inputRef, label, multiline, name, placeholder, props, size, width, onChange, InputProps }: SectionContents) => JSX.Element;
18
- export default ProfileTextField;
1
+ import { FieldError } from 'react-hook-form/dist/types/form';
2
+ type SectionContents = {
3
+ defaultValue?: string | number;
4
+ error?: boolean;
5
+ helperText: string | undefined | (FieldError | undefined)[];
6
+ inputRef?: ((instance: any) => void) | null | undefined;
7
+ label?: string;
8
+ multiline?: boolean;
9
+ name?: string;
10
+ placeholder?: string;
11
+ props?: unknown;
12
+ size?: 'small' | 'medium' | undefined;
13
+ onChange?: ((value: any) => void) | undefined;
14
+ width?: boolean;
15
+ InputProps?: any;
16
+ };
17
+ declare const ProfileTextField: ({ defaultValue, error, helperText, inputRef, label, multiline, name, placeholder, props, size, width, onChange, InputProps }: SectionContents) => JSX.Element;
18
+ export default ProfileTextField;
@@ -1,16 +1,16 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const TextField_1 = __importDefault(require("@material-ui/core/TextField"));
8
- const ProfileTextField = ({ defaultValue, error, helperText, inputRef, label, multiline = false, name, placeholder, props, size, width = false, onChange, InputProps }) => {
9
- return (onChange ? react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
10
- shrink: true
11
- }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined', onChange: onChange, classes: { root: 'inputCurrency' } })) :
12
- react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
13
- shrink: true
14
- }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined' })));
15
- };
16
- exports.default = ProfileTextField;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const TextField_1 = __importDefault(require("@material-ui/core/TextField"));
8
+ const ProfileTextField = ({ defaultValue, error, helperText, inputRef, label, multiline = false, name, placeholder, props, size, width = false, onChange, InputProps }) => {
9
+ return (onChange ? react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
10
+ shrink: true
11
+ }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined', onChange: onChange, classes: { root: 'inputCurrency' } })) :
12
+ react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
13
+ shrink: true
14
+ }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined' })));
15
+ };
16
+ exports.default = ProfileTextField;
@@ -1,7 +1,7 @@
1
- declare const StyledActionButtons: ({ closeOnClick, isDisabled, isLoading, handleSubmit }: {
2
- closeOnClick: () => void;
3
- isDisabled: boolean;
4
- isLoading: boolean;
5
- handleSubmit?: () => void;
6
- }) => JSX.Element;
7
- export default StyledActionButtons;
1
+ declare const StyledActionButtons: ({ closeOnClick, isDisabled, isLoading, handleSubmit }: {
2
+ closeOnClick: () => void;
3
+ isDisabled: boolean;
4
+ isLoading: boolean;
5
+ handleSubmit?: () => void;
6
+ }) => JSX.Element;
7
+ export default StyledActionButtons;
@@ -1,15 +1,15 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const core_1 = require("@material-ui/core");
8
- const Button_1 = __importDefault(require("@material-ui/core/Button"));
9
- const Loader_1 = __importDefault(require("./Loader"));
10
- const StyledActionButtons = ({ closeOnClick, isDisabled, isLoading, handleSubmit }) => {
11
- return (react_1.default.createElement(core_1.DialogActions, null,
12
- react_1.default.createElement(Button_1.default, { variant: 'outlined', onClick: closeOnClick, color: 'primary' }, "Close"),
13
- react_1.default.createElement(Button_1.default, { color: 'default', disabled: isDisabled, key: String(isDisabled), onClick: handleSubmit, variant: 'contained' }, isLoading ? react_1.default.createElement(Loader_1.default, { key: String(isLoading) }) : 'Save')));
14
- };
15
- exports.default = StyledActionButtons;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const core_1 = require("@material-ui/core");
8
+ const Button_1 = __importDefault(require("@material-ui/core/Button"));
9
+ const Loader_1 = __importDefault(require("./Loader"));
10
+ const StyledActionButtons = ({ closeOnClick, isDisabled, isLoading, handleSubmit }) => {
11
+ return (react_1.default.createElement(core_1.DialogActions, null,
12
+ react_1.default.createElement(Button_1.default, { variant: 'outlined', onClick: closeOnClick, color: 'primary' }, "Close"),
13
+ react_1.default.createElement(Button_1.default, { color: 'default', disabled: isDisabled, key: String(isDisabled), onClick: handleSubmit, variant: 'contained' }, isLoading ? react_1.default.createElement(Loader_1.default, { key: String(isLoading) }) : 'Save')));
14
+ };
15
+ exports.default = StyledActionButtons;