@paro.io/expert-shared-components 1.4.11 → 1.5.0
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.
- package/lib/components/DocumentCenter/ClientDocumentsTable.d.ts +18 -0
- package/lib/components/DocumentCenter/ClientDocumentsTable.js +378 -0
- package/lib/components/DocumentCenter/DeleteDocumentModal.d.ts +8 -0
- package/lib/components/DocumentCenter/DeleteDocumentModal.js +13 -0
- package/lib/components/DocumentCenter/DocumentCenter.d.ts +23 -0
- package/lib/components/DocumentCenter/DocumentCenter.js +185 -0
- package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -0
- package/lib/components/DocumentCenter/DocumentTable.js +350 -0
- package/lib/components/DocumentCenter/DocumentUploadRow.d.ts +26 -0
- package/lib/components/DocumentCenter/DocumentUploadRow.js +173 -0
- package/lib/components/DocumentCenter/ParoDocumentsTable.d.ts +16 -0
- package/lib/components/DocumentCenter/ParoDocumentsTable.js +380 -0
- package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -0
- package/lib/components/DocumentCenter/UploadFilesButton.js +29 -0
- package/lib/components/DocumentCenter/index.d.ts +1 -0
- package/lib/components/DocumentCenter/index.js +5 -0
- package/lib/components/ExpertProfileHeader/Banner.d.ts +6 -0
- package/lib/components/ExpertProfileHeader/Banner.js +7 -5
- package/lib/components/ExpertProfileHeader/EarningsSection.d.ts +2 -1
- package/lib/components/ExpertProfileHeader/EarningsSection.js +8 -3
- package/lib/components/ExpertProfileHeader/ExpertProfileHeader.js +1 -1
- package/lib/components/shared/ToastNotification.d.ts +10 -0
- package/lib/components/shared/ToastNotification.js +63 -0
- package/lib/components/shared/utils.d.ts +29 -0
- package/lib/components/shared/utils.js +162 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.ParoDocumentsTable = void 0;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const core_1 = require("@material-ui/core");
|
|
41
|
+
const Pagination_1 = __importDefault(require("../Reviews/Pagination"));
|
|
42
|
+
const DocumentUploadRow_1 = require("./DocumentUploadRow");
|
|
43
|
+
const base_icons_1 = require("@paro.io/base-icons");
|
|
44
|
+
const ClientDocumentsTable_1 = require("./ClientDocumentsTable");
|
|
45
|
+
const date_fns_1 = require("date-fns");
|
|
46
|
+
const DeleteDocumentModal_1 = require("./DeleteDocumentModal");
|
|
47
|
+
const utils_1 = require("../shared/utils");
|
|
48
|
+
const headCells = [
|
|
49
|
+
{
|
|
50
|
+
id: 'fileName',
|
|
51
|
+
label: 'File Name',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'docType',
|
|
55
|
+
label: 'Document Type',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'uploadedDate',
|
|
59
|
+
label: 'Uploaded Date',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'expiryDate',
|
|
63
|
+
label: 'Expiry Date',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
function descendingComparator(a, b, orderBy) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
if (orderBy === 'uploadedDate' || orderBy === 'expiryDate') {
|
|
69
|
+
//@ts-ignore
|
|
70
|
+
const dateA = a === null || a === void 0 ? void 0 : a[orderBy];
|
|
71
|
+
//@ts-ignore
|
|
72
|
+
const dateB = b === null || b === void 0 ? void 0 : b[orderBy];
|
|
73
|
+
//@ts-ignore
|
|
74
|
+
if (dateB < dateA) {
|
|
75
|
+
return -1;
|
|
76
|
+
}
|
|
77
|
+
//@ts-ignore
|
|
78
|
+
if (dateB > dateA) {
|
|
79
|
+
return 1;
|
|
80
|
+
}
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
else if (orderBy === 'fileName' || orderBy === 'docType') {
|
|
84
|
+
//@ts-ignore
|
|
85
|
+
const valueA = (_a = a === null || a === void 0 ? void 0 : a[orderBy]) !== null && _a !== void 0 ? _a : "";
|
|
86
|
+
//@ts-ignore
|
|
87
|
+
const valueB = (_b = b === null || b === void 0 ? void 0 : b[orderBy]) !== null && _b !== void 0 ? _b : "";
|
|
88
|
+
if (valueB < valueA) {
|
|
89
|
+
return -1;
|
|
90
|
+
}
|
|
91
|
+
if (valueB > valueA) {
|
|
92
|
+
return 1;
|
|
93
|
+
}
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
(0, utils_1.compareItems)(a, b, orderBy);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const ParoDocumentsTable = ({ legacyFreelancerId, expiryDate, setExpiryDate, expertFiles, setExpertFiles, uploadFileData, deleteFileMutation, updateFreelancerExpiryMutation, foldername, paroDocuments, getFileLazyQuery, getFilesLazyQuery, }) => {
|
|
101
|
+
const classes = (0, ClientDocumentsTable_1.useStyles)();
|
|
102
|
+
const [order, setOrder] = react_1.default.useState('desc');
|
|
103
|
+
const [orderBy, setOrderBy] = react_1.default.useState('uploadedDate');
|
|
104
|
+
const [currentPage, setCurrentPage] = (0, react_1.useState)(1);
|
|
105
|
+
const [perPageItems, setPerPageItems] = (0, react_1.useState)(10);
|
|
106
|
+
const [files, setFiles] = (0, react_1.useState)(expertFiles);
|
|
107
|
+
const [documentName, setDocumentName] = (0, react_1.useState)('');
|
|
108
|
+
const [clientAndProject, setClientAndProject] = (0, react_1.useState)('');
|
|
109
|
+
const [docType, setDocType] = (0, react_1.useState)('');
|
|
110
|
+
const [searchText, setSearchText] = (0, react_1.useState)('');
|
|
111
|
+
const [isUploading, setIsUploading] = (0, react_1.useState)(false);
|
|
112
|
+
const [downloadFilename, setDownloadFilename] = (0, react_1.useState)('');
|
|
113
|
+
const [apiFoldername, setApiFoldername] = (0, react_1.useState)('');
|
|
114
|
+
const [isDeleteModalOpen, setDeleteModalOpen] = (0, react_1.useState)(false);
|
|
115
|
+
const [deleteFileName, setDeleteFileName] = (0, react_1.useState)('');
|
|
116
|
+
const [insuranceExpiryDate, setInsuranceExpiryDate] = (0, react_1.useState)(null);
|
|
117
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
118
|
+
const [fileData, setFileData] = (0, react_1.useState)('');
|
|
119
|
+
const firstItem = (currentPage - 1) * perPageItems;
|
|
120
|
+
const lastItem = (currentPage - 1) * perPageItems + perPageItems;
|
|
121
|
+
const tableData = (files === null || files === void 0 ? void 0 : files.length) ? files === null || files === void 0 ? void 0 : files.map((file) => {
|
|
122
|
+
var _a, _b, _c, _d;
|
|
123
|
+
return {
|
|
124
|
+
fileName: ((_a = file === null || file === void 0 ? void 0 : file.filename) === null || _a === void 0 ? void 0 : _a.split('/').pop()) || "-",
|
|
125
|
+
docType: ((_b = file.filename) === null || _b === void 0 ? void 0 : _b.split('/').slice(-2, -1)[0].includes('auth0')) ? '-' : (_c = file.filename) === null || _c === void 0 ? void 0 : _c.split('/').slice(-2, -1)[0],
|
|
126
|
+
uploadedDate: (0, utils_1.formatDate)(Number(file.lastmodified)),
|
|
127
|
+
expiryDate: ((_d = file.filename) === null || _d === void 0 ? void 0 : _d.includes('/EO Insurance/')) ? expiryDate : 'N/A',
|
|
128
|
+
};
|
|
129
|
+
}) : [];
|
|
130
|
+
(0, react_1.useEffect)(() => {
|
|
131
|
+
const sortByTextProjects = searchText === ''
|
|
132
|
+
? expertFiles
|
|
133
|
+
: expertFiles.filter((file) => {
|
|
134
|
+
var _a, _b;
|
|
135
|
+
return ((_a = file === null || file === void 0 ? void 0 : file.filename) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchText.toLowerCase())) ||
|
|
136
|
+
((_b = file === null || file === void 0 ? void 0 : file.documentType) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchText.toLowerCase()));
|
|
137
|
+
});
|
|
138
|
+
setFiles(sortByTextProjects);
|
|
139
|
+
}, [searchText]);
|
|
140
|
+
const getFileData = (_a) => __awaiter(void 0, [_a], void 0, function* ({ fileName, folderName }) {
|
|
141
|
+
var _b, _c;
|
|
142
|
+
const fileData = yield getFileLazyQuery({
|
|
143
|
+
skip: !downloadFilename,
|
|
144
|
+
variables: {
|
|
145
|
+
input: {
|
|
146
|
+
foldername: folderName,
|
|
147
|
+
filename: fileName,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
if ((_c = (_b = fileData === null || fileData === void 0 ? void 0 : fileData.data) === null || _b === void 0 ? void 0 : _b.getFile) === null || _c === void 0 ? void 0 : _c.data) {
|
|
152
|
+
(0, utils_1.showToast)('success', 'File Data fetched successfully!');
|
|
153
|
+
setFileData(fileData);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
(0, utils_1.showToast)('warning', 'Failed to fetch file data! Please try again.');
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
(0, react_1.useEffect)(() => {
|
|
160
|
+
var _a, _b;
|
|
161
|
+
if (!fileData || !fileData.data || !fileData.data.getFile || !fileData.data.getFile.data) {
|
|
162
|
+
console.error("Invalid file data.");
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const a = document.createElement('a');
|
|
167
|
+
const mimeType = (0, utils_1.getFileMimeType)(downloadFilename);
|
|
168
|
+
if (mimeType === 'application/pdf') {
|
|
169
|
+
//handle pdf type files
|
|
170
|
+
(0, utils_1.handleDownloadPdf)({ fileData, downloadFilename });
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// handle other type files
|
|
174
|
+
a.href = `data:${mimeType};base64,${(_b = (_a = fileData === null || fileData === void 0 ? void 0 : fileData.data) === null || _a === void 0 ? void 0 : _a.getFile) === null || _b === void 0 ? void 0 : _b.data}`;
|
|
175
|
+
a.download = downloadFilename;
|
|
176
|
+
a.click();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
console.error('Error downloading file:', error);
|
|
181
|
+
(0, utils_1.showToast)('warning', 'Failed to download file! Please try again.');
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
setDownloadFilename('');
|
|
185
|
+
setApiFoldername('');
|
|
186
|
+
setFileData('');
|
|
187
|
+
}
|
|
188
|
+
}, [fileData]);
|
|
189
|
+
const handleRequestSort = (event, property) => {
|
|
190
|
+
const isDesc = orderBy === property && order === 'desc';
|
|
191
|
+
setOrder(isDesc ? 'asc' : 'desc');
|
|
192
|
+
setOrderBy(property);
|
|
193
|
+
};
|
|
194
|
+
const createSortHandler = (property) => (event) => {
|
|
195
|
+
handleRequestSort(event, property);
|
|
196
|
+
};
|
|
197
|
+
const refetchFiles = (isUpload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
198
|
+
try {
|
|
199
|
+
const { data } = yield getFilesLazyQuery({
|
|
200
|
+
variables: { input: { foldername: foldername } },
|
|
201
|
+
fetchPolicy: 'network-only',
|
|
202
|
+
});
|
|
203
|
+
if (docType === 'EO Insurance' && isUpload) {
|
|
204
|
+
insuranceExpiryDate && setExpiryDate((0, utils_1.formatDate)(insuranceExpiryDate));
|
|
205
|
+
}
|
|
206
|
+
setExpertFiles(data === null || data === void 0 ? void 0 : data.getFiles);
|
|
207
|
+
setFiles(data === null || data === void 0 ? void 0 : data.getFiles);
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
console.error('Error refetching query:', error);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
const handleDelete = () => {
|
|
214
|
+
setIsUploading(true);
|
|
215
|
+
if (apiFoldername.split('/')[1] === 'EO Insurance') {
|
|
216
|
+
updateFreelancerExpiryMutation({
|
|
217
|
+
variables: {
|
|
218
|
+
id: legacyFreelancerId,
|
|
219
|
+
},
|
|
220
|
+
})
|
|
221
|
+
.catch((err) => { console.log(`Error deleting insurance from freelancer table ${err}`); });
|
|
222
|
+
setInsuranceExpiryDate(null);
|
|
223
|
+
}
|
|
224
|
+
deleteFileMutation({
|
|
225
|
+
variables: {
|
|
226
|
+
input: {
|
|
227
|
+
foldername: apiFoldername,
|
|
228
|
+
filename: deleteFileName,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
onCompleted: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
232
|
+
refetchFiles(false);
|
|
233
|
+
})
|
|
234
|
+
})
|
|
235
|
+
.then(() => {
|
|
236
|
+
toggleDeleteModal(deleteFileName);
|
|
237
|
+
(0, utils_1.showToast)('success', 'File deleted successfully!');
|
|
238
|
+
})
|
|
239
|
+
.catch((err) => {
|
|
240
|
+
toggleDeleteModal(deleteFileName);
|
|
241
|
+
console.log(`Error deleting file ${err}`);
|
|
242
|
+
(0, utils_1.showToast)('warning', 'Failed to delete file! Please retry.');
|
|
243
|
+
});
|
|
244
|
+
setIsUploading(false);
|
|
245
|
+
};
|
|
246
|
+
const handleDownloadFile = (fileName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
247
|
+
var _a, _b, _c;
|
|
248
|
+
if (fileName) {
|
|
249
|
+
setDownloadFilename(fileName);
|
|
250
|
+
const segments = (_b = (_a = files === null || files === void 0 ? void 0 : files.filter((row) => row.filename.split('/').pop() === fileName)[0]) === null || _a === void 0 ? void 0 : _a.filename) === null || _b === void 0 ? void 0 : _b.split('/');
|
|
251
|
+
const folderName = (_c = segments === null || segments === void 0 ? void 0 : segments.slice(0, segments.length - 1)) === null || _c === void 0 ? void 0 : _c.join('/');
|
|
252
|
+
setApiFoldername(folderName);
|
|
253
|
+
getFileData({ fileName, folderName });
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
const toggleDeleteModal = (fileName) => {
|
|
257
|
+
var _a, _b, _c;
|
|
258
|
+
setDeleteModalOpen(!isDeleteModalOpen);
|
|
259
|
+
if (fileName) {
|
|
260
|
+
setDeleteFileName(fileName);
|
|
261
|
+
const segments = (_b = (_a = files === null || files === void 0 ? void 0 : files.filter((row) => row.filename.split('/').pop() === fileName)[0]) === null || _a === void 0 ? void 0 : _a.filename) === null || _b === void 0 ? void 0 : _b.split('/');
|
|
262
|
+
setApiFoldername((_c = segments === null || segments === void 0 ? void 0 : segments.slice(0, segments.length - 1)) === null || _c === void 0 ? void 0 : _c.join('/'));
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
const uploadFile = (fileForUpload, fileExtension) => {
|
|
266
|
+
setIsUploading(true);
|
|
267
|
+
uploadFileData({
|
|
268
|
+
variables: {
|
|
269
|
+
input: {
|
|
270
|
+
foldername,
|
|
271
|
+
subfolder: docType,
|
|
272
|
+
filename: `${documentName}.${fileExtension}`,
|
|
273
|
+
data: fileForUpload,
|
|
274
|
+
expirationDate: ((docType === 'EO Insurance') && insuranceExpiryDate) ? insuranceExpiryDate : '',
|
|
275
|
+
valid: true,
|
|
276
|
+
sourceOfEOInsurance: 'Dashboard',
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
onCompleted: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
280
|
+
refetchFiles(true);
|
|
281
|
+
})
|
|
282
|
+
})
|
|
283
|
+
.then(() => {
|
|
284
|
+
(0, utils_1.showToast)('success', 'File Uploaded successfully!');
|
|
285
|
+
})
|
|
286
|
+
.catch((err) => {
|
|
287
|
+
(0, utils_1.showToast)('warning', 'Upload failed! Please try again.');
|
|
288
|
+
});
|
|
289
|
+
setIsUploading(false);
|
|
290
|
+
setApiFoldername('');
|
|
291
|
+
setDocumentName('');
|
|
292
|
+
};
|
|
293
|
+
const handleUpload = (event) => {
|
|
294
|
+
const selectedFile = event.target.files && event.target.files[0];
|
|
295
|
+
if (!(0, utils_1.validateFileUpload)(selectedFile, false)) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (selectedFile) {
|
|
299
|
+
const fileExtension = selectedFile.name.substring(selectedFile.name.lastIndexOf('.') + 1);
|
|
300
|
+
const reader = new FileReader();
|
|
301
|
+
reader.onloadend = () => {
|
|
302
|
+
const fileForUpload = String(reader.result).split(';base64,')[1];
|
|
303
|
+
uploadFile(fileForUpload, fileExtension);
|
|
304
|
+
};
|
|
305
|
+
reader.readAsDataURL(selectedFile);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
const handleDateChange = (date) => {
|
|
309
|
+
if (date) {
|
|
310
|
+
const currentDate = (0, date_fns_1.startOfDay)(new Date);
|
|
311
|
+
if ((0, date_fns_1.isBefore)(date, currentDate)) {
|
|
312
|
+
setError('The expiration date cannot be in the past.');
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
setInsuranceExpiryDate(date);
|
|
316
|
+
setError(null);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
return (react_1.default.createElement(utils_1.CustomPaper, null,
|
|
321
|
+
react_1.default.createElement(DocumentUploadRow_1.DocumentUploadRow, { documentName: documentName, setDocumentName: setDocumentName, clientAndProject: clientAndProject, setClientAndProject: setClientAndProject, docType: docType, setDocType: setDocType, searchText: searchText, setSearchText: setSearchText, paroDocuments: paroDocuments, handleUpload: handleUpload, expiryDate: insuranceExpiryDate, handleDateChange: handleDateChange, error: error, isUploading: isUploading }),
|
|
322
|
+
react_1.default.createElement(core_1.Box, { mt: 2 }, (files === null || files === void 0 ? void 0 : files.length) > 0 ?
|
|
323
|
+
react_1.default.createElement(core_1.Table, { style: { overflow: 'auto' } },
|
|
324
|
+
react_1.default.createElement(core_1.TableHead, null,
|
|
325
|
+
react_1.default.createElement(core_1.TableRow, { className: [classes.tableCellBorder, classes.shade].join(" ") },
|
|
326
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" }),
|
|
327
|
+
headCells.map((headCell) => (react_1.default.createElement(core_1.TableCell, { key: headCell.id, sortDirection: orderBy === headCell.id ? order : false, align: "center", className: classes.tableCell },
|
|
328
|
+
react_1.default.createElement(core_1.TableSortLabel, { active: orderBy === headCell.id, direction: orderBy === headCell.id ? order : 'asc', onClick: createSortHandler(headCell.id) },
|
|
329
|
+
react_1.default.createElement("div", { className: "flex flex-row items-center gap-x-1" },
|
|
330
|
+
react_1.default.createElement("div", { className: "flex flex-col justify-center items-center" },
|
|
331
|
+
react_1.default.createElement("b", null, headCell.label)),
|
|
332
|
+
orderBy === headCell.id && null))))),
|
|
333
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" }))),
|
|
334
|
+
react_1.default.createElement(core_1.TableBody, null, (0, utils_1.stableSort)(tableData, (0, utils_1.getComparator)(order, orderBy, descendingComparator)).slice(firstItem, lastItem).map((row, index) => {
|
|
335
|
+
const { fileName, docType, uploadedDate, expiryDate, } = row;
|
|
336
|
+
return (react_1.default.createElement(core_1.TableRow, { key: index },
|
|
337
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" }, index + 1),
|
|
338
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" },
|
|
339
|
+
react_1.default.createElement("a", { onClick: () => handleDownloadFile(fileName), style: {
|
|
340
|
+
color: 'blue',
|
|
341
|
+
textDecoration: 'underline',
|
|
342
|
+
cursor: 'pointer',
|
|
343
|
+
} }, fileName)),
|
|
344
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" }, docType),
|
|
345
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" }, uploadedDate),
|
|
346
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell, align: "center" }, expiryDate),
|
|
347
|
+
react_1.default.createElement(core_1.TableCell, { className: classes.tableCell },
|
|
348
|
+
react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: "row", justify: "space-evenly", alignItems: "center" },
|
|
349
|
+
react_1.default.createElement(core_1.Tooltip, { arrow: true, placement: "top", interactive: true, className: "whitespace-nowrap", title: "Download Document" },
|
|
350
|
+
react_1.default.createElement(core_1.IconButton, { onClick: () => handleDownloadFile(fileName) },
|
|
351
|
+
" ",
|
|
352
|
+
react_1.default.createElement(base_icons_1.IconDocumentDownload, { size: "sm" }),
|
|
353
|
+
" ")),
|
|
354
|
+
react_1.default.createElement(core_1.Tooltip, { arrow: true, placement: "top", interactive: true, className: "whitespace-nowrap", title: "This will delete the document for you and the Client" },
|
|
355
|
+
react_1.default.createElement(core_1.IconButton, { onClick: () => toggleDeleteModal(fileName) },
|
|
356
|
+
" ",
|
|
357
|
+
react_1.default.createElement(base_icons_1.IconTrash, { size: "sm" }),
|
|
358
|
+
" "))))));
|
|
359
|
+
})))
|
|
360
|
+
:
|
|
361
|
+
react_1.default.createElement(core_1.Box, null,
|
|
362
|
+
react_1.default.createElement(core_1.Divider, null),
|
|
363
|
+
react_1.default.createElement(core_1.Typography, { variant: "h6", style: { fontWeight: 'bold' }, align: 'center' }, "No Documents Found"),
|
|
364
|
+
react_1.default.createElement(core_1.Typography, { variant: "body1", align: 'center' }, "You haven\u2019t uploaded any documents yet. Click above and upload any .pdf , .doc, .docx, .ppt, .xls, .xlsx file. Your resume is a great way to start."))),
|
|
365
|
+
(expertFiles === null || expertFiles === void 0 ? void 0 : expertFiles.length) >= 10 && react_1.default.createElement(core_1.Box, { m: 2 },
|
|
366
|
+
react_1.default.createElement(Pagination_1.default, { total: expertFiles === null || expertFiles === void 0 ? void 0 : expertFiles.length, currentPage: currentPage, setCurrentPage: setCurrentPage, perPageItems: perPageItems, setPerPageItems: setPerPageItems, displayText: "projects" })),
|
|
367
|
+
react_1.default.createElement(DeleteDocumentModal_1.DeleteDocumentModal, { isDeleteModalOpen: isDeleteModalOpen, setDeleteModalOpen: setDeleteModalOpen, handleDelete: handleDelete, content: apiFoldername.split('/')[1] !== "EO Insurance" ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
368
|
+
"Are you sure you want to delete document ",
|
|
369
|
+
react_1.default.createElement("strong", null, deleteFileName),
|
|
370
|
+
" ?",
|
|
371
|
+
react_1.default.createElement("br", null),
|
|
372
|
+
"If you continue, this document will no longer be available.")) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
373
|
+
"Are you sure you want to delete Insurance document ",
|
|
374
|
+
react_1.default.createElement("strong", null, deleteFileName),
|
|
375
|
+
" ?",
|
|
376
|
+
react_1.default.createElement("br", null),
|
|
377
|
+
react_1.default.createElement("strong", null, "Note:"),
|
|
378
|
+
" You hold only one insurance document. Deleting it might effect your 'Matching'.")) })));
|
|
379
|
+
};
|
|
380
|
+
exports.ParoDocumentsTable = ParoDocumentsTable;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
exports.UploadFilesButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const base_ui_1 = require("@paro.io/base-ui");
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
const UploadFilesButton = ({ onFileSelect, isLoading, }) => {
|
|
11
|
+
const fileInputRef = (0, react_2.useRef)(null);
|
|
12
|
+
const handleClick = () => {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
15
|
+
};
|
|
16
|
+
const handleFileChange = (event) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
19
|
+
if (file) {
|
|
20
|
+
onFileSelect(file);
|
|
21
|
+
}
|
|
22
|
+
// Reset input value to allow uploading the same file again
|
|
23
|
+
event.target.value = '';
|
|
24
|
+
};
|
|
25
|
+
return (react_1.default.createElement("div", null,
|
|
26
|
+
react_1.default.createElement("input", { type: "file", ref: fileInputRef, onChange: handleFileChange, className: "hidden", accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx" }),
|
|
27
|
+
react_1.default.createElement(base_ui_1.Button, { onClick: handleClick, disabled: isLoading })));
|
|
28
|
+
};
|
|
29
|
+
exports.UploadFilesButton = UploadFilesButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DocumentCenter } from './DocumentCenter';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocumentCenter = void 0;
|
|
4
|
+
var DocumentCenter_1 = require("./DocumentCenter");
|
|
5
|
+
Object.defineProperty(exports, "DocumentCenter", { enumerable: true, get: function () { return DocumentCenter_1.DocumentCenter; } });
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
interface BannerProps {
|
|
2
2
|
lifetimeFSV: number;
|
|
3
3
|
}
|
|
4
|
+
export declare const fsvRanges: {
|
|
5
|
+
fsv: number;
|
|
6
|
+
bgColor: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const getBGColor: (fsv: number) => string;
|
|
4
10
|
declare const Banner: ({ lifetimeFSV }: BannerProps) => JSX.Element;
|
|
5
11
|
export default Banner;
|
|
@@ -3,24 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getBGColor = exports.fsvRanges = void 0;
|
|
6
7
|
const react_1 = __importDefault(require("react"));
|
|
7
8
|
const base_icons_1 = require("@paro.io/base-icons");
|
|
8
9
|
const core_1 = require("@material-ui/core");
|
|
9
|
-
|
|
10
|
-
{ fsv: 500000, bgColor: '#F9BABF', message: 'Experts who have accrued $
|
|
10
|
+
exports.fsvRanges = [
|
|
11
|
+
{ fsv: 500000, bgColor: '#F9BABF', message: 'Experts who have accrued $500K+ in FSV tend to churn more than the average Expert' },
|
|
11
12
|
{ fsv: 100000, bgColor: '#FBDD9B', message: 'Experts who have accrued $100K+ in FSV tend to churn more than the average Expert' },
|
|
12
13
|
{ fsv: 85000, bgColor: '#A3C9E5', message: 'Experts who have accrued $85K+ in FSV tend to churn more than the average Expert' },
|
|
13
14
|
];
|
|
14
15
|
const getHoverMessage = (fsv) => {
|
|
15
|
-
const threshold = fsvRanges.find(threshold => fsv >= threshold.fsv);
|
|
16
|
+
const threshold = exports.fsvRanges.find(threshold => fsv >= threshold.fsv);
|
|
16
17
|
return threshold ? threshold.message : '';
|
|
17
18
|
};
|
|
18
19
|
const getBGColor = (fsv) => {
|
|
19
|
-
const threshold = fsvRanges.find(threshold => fsv >= threshold.fsv);
|
|
20
|
+
const threshold = exports.fsvRanges.find(threshold => fsv >= threshold.fsv);
|
|
20
21
|
return threshold ? threshold.bgColor : '';
|
|
21
22
|
};
|
|
23
|
+
exports.getBGColor = getBGColor;
|
|
22
24
|
const Banner = ({ lifetimeFSV }) => {
|
|
23
|
-
const backgroundColor = getBGColor(lifetimeFSV);
|
|
25
|
+
const backgroundColor = (0, exports.getBGColor)(lifetimeFSV);
|
|
24
26
|
const hoverText = getHoverMessage(lifetimeFSV);
|
|
25
27
|
return (react_1.default.createElement(core_1.Box, { style: {
|
|
26
28
|
backgroundColor: backgroundColor,
|
|
@@ -14,6 +14,7 @@ interface EarningsSectionProps {
|
|
|
14
14
|
lifetimeIRPR: any;
|
|
15
15
|
lifetimeWinRate: any;
|
|
16
16
|
hasCompletedProjects: boolean;
|
|
17
|
+
lifetimeFSV: any;
|
|
17
18
|
}
|
|
18
|
-
declare const EarningsSection: ({ expertServiceLinesPlus, firmTags, haveATeamProp, expertLevels, currentMonthGoalHours, expertIRPRRatio, winRate, expertIRPRRatioPrev, winRatePrev, earnings, upsell, crossSell, lifetimeIRPR, lifetimeWinRate, hasCompletedProjects }: EarningsSectionProps) => JSX.Element;
|
|
19
|
+
declare const EarningsSection: ({ expertServiceLinesPlus, firmTags, haveATeamProp, expertLevels, currentMonthGoalHours, expertIRPRRatio, winRate, expertIRPRRatioPrev, winRatePrev, earnings, upsell, crossSell, lifetimeIRPR, lifetimeWinRate, hasCompletedProjects, lifetimeFSV }: EarningsSectionProps) => JSX.Element;
|
|
19
20
|
export default EarningsSection;
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const core_1 = require("@material-ui/core");
|
|
18
18
|
const styles_1 = require("@material-ui/core/styles");
|
|
19
19
|
const react_1 = __importDefault(require("react"));
|
|
20
|
+
const Banner_1 = require("./Banner");
|
|
20
21
|
const useStyles = (0, styles_1.makeStyles)((theme) => ({
|
|
21
22
|
chip: (props) => ({
|
|
22
23
|
background: '#248384',
|
|
@@ -60,9 +61,9 @@ const FirmTags = (_a) => {
|
|
|
60
61
|
margin: 1,
|
|
61
62
|
} }, chipProps));
|
|
62
63
|
};
|
|
63
|
-
const EarningsInfo = ({ label, value }) => (react_1.default.createElement(core_1.Box, { mr: 2, display: "flex", justifyContent: "space-between", alignItems: "center" },
|
|
64
|
+
const EarningsInfo = ({ label, value, textColor = 'black' }) => (react_1.default.createElement(core_1.Box, { mr: 2, display: "flex", justifyContent: "space-between", alignItems: "center" },
|
|
64
65
|
react_1.default.createElement(core_1.Typography, { variant: "body2" }, label),
|
|
65
|
-
react_1.default.createElement("b",
|
|
66
|
+
react_1.default.createElement("b", { style: { color: textColor } }, value)));
|
|
66
67
|
const DataCell = ({ label, value }) => {
|
|
67
68
|
//@ts-ignore
|
|
68
69
|
const classes = useStyles();
|
|
@@ -101,9 +102,10 @@ const ToLocalStringFn = (value) => {
|
|
|
101
102
|
maximumFractionDigits: 2,
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
|
-
const EarningsSection = ({ expertServiceLinesPlus, firmTags, haveATeamProp, expertLevels, currentMonthGoalHours, expertIRPRRatio, winRate, expertIRPRRatioPrev, winRatePrev, earnings, upsell, crossSell, lifetimeIRPR, lifetimeWinRate, hasCompletedProjects }) => {
|
|
105
|
+
const EarningsSection = ({ expertServiceLinesPlus, firmTags, haveATeamProp, expertLevels, currentMonthGoalHours, expertIRPRRatio, winRate, expertIRPRRatioPrev, winRatePrev, earnings, upsell, crossSell, lifetimeIRPR, lifetimeWinRate, hasCompletedProjects, lifetimeFSV }) => {
|
|
105
106
|
var _a;
|
|
106
107
|
const earning = earnings && (earnings === null || earnings === void 0 ? void 0 : earnings.length) > 0 && ((_a = earnings[0]) === null || _a === void 0 ? void 0 : _a.earnings);
|
|
108
|
+
const backgroundColor = (0, Banner_1.getBGColor)(lifetimeFSV);
|
|
107
109
|
return (react_1.default.createElement(core_1.Grid, { item: true, style: { width: '100%', padding: '6px' } },
|
|
108
110
|
((expertServiceLinesPlus === null || expertServiceLinesPlus === void 0 ? void 0 : expertServiceLinesPlus.length) > 0 || (firmTags === null || firmTags === void 0 ? void 0 : firmTags.length) > 0 || haveATeamProp || (expertLevels === null || expertLevels === void 0 ? void 0 : expertLevels.length) > 0) && react_1.default.createElement(react_1.default.Fragment, null,
|
|
109
111
|
react_1.default.createElement(core_1.Grid, null,
|
|
@@ -134,6 +136,9 @@ const EarningsSection = ({ expertServiceLinesPlus, firmTags, haveATeamProp, expe
|
|
|
134
136
|
react_1.default.createElement(core_1.Box, { mb: 2 },
|
|
135
137
|
react_1.default.createElement(core_1.Divider, null)),
|
|
136
138
|
react_1.default.createElement(EarningsInfo, { label: "% to Goal", value: currentMonthGoalHours && earning ? `${ToLocalStringFn(((earning / currentMonthGoalHours) * 100).toFixed(2))} %` : 'N/A' }),
|
|
139
|
+
react_1.default.createElement(core_1.Box, { mb: 2 },
|
|
140
|
+
react_1.default.createElement(core_1.Divider, null)),
|
|
141
|
+
react_1.default.createElement(EarningsInfo, { label: "Lifetime FSV", value: lifetimeFSV ? ToLocalStringFn(lifetimeFSV) : 'N/A', textColor: backgroundColor }),
|
|
137
142
|
react_1.default.createElement(core_1.Box, { mb: 2 },
|
|
138
143
|
react_1.default.createElement(core_1.Divider, null)),
|
|
139
144
|
react_1.default.createElement(core_1.Box, { mb: 2 },
|
|
@@ -221,7 +221,7 @@ const ExpertProfileHeader = ({ expertId, address: addressForReducer, companyName
|
|
|
221
221
|
react_1.default.createElement(NetworkSection_1.default, { handleScrollToBottom: isInternal && handleScrollToBottom ? handleScrollToBottom : () => { }, preferenceTasks: preferenceTasks, isWhiteLabel: isWhiteLabel, detailsSectionCompleted: detailsSectionCompleted, infoColor: infoColor, leftSideStatus: leftSideStatus, rightSideStatus: rightSideStatus, isInternal: isInternal }),
|
|
222
222
|
react_1.default.createElement(core_1.Divider, { orientation: isSmallScreen ? 'horizontal' : 'vertical' })),
|
|
223
223
|
react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
|
|
224
|
-
react_1.default.createElement(EarningsSection_1.default, { expertServiceLinesPlus: expertServiceLinesPlus, firmTags: firmTags, haveATeamProp: haveATeamProp, expertLevels: expertLevels, currentMonthGoalHours: currentMonthGoalHours, expertIRPRRatio: expertIRPRRatio, winRate: winRate, expertIRPRRatioPrev: expertIRPRRatioPrev, winRatePrev: winRatePrev, earnings: earnings, upsell: upsell, crossSell: crossSell, lifetimeIRPR: lifetimeIRPR, lifetimeWinRate: lifetimeWinRate, hasCompletedProjects: (_k = expertMetricsData === null || expertMetricsData === void 0 ? void 0 : expertMetricsData.getExpertMetrics) === null || _k === void 0 ? void 0 : _k.lastProjectCompleted }),
|
|
224
|
+
react_1.default.createElement(EarningsSection_1.default, { expertServiceLinesPlus: expertServiceLinesPlus, firmTags: firmTags, haveATeamProp: haveATeamProp, expertLevels: expertLevels, currentMonthGoalHours: currentMonthGoalHours, expertIRPRRatio: expertIRPRRatio, winRate: winRate, expertIRPRRatioPrev: expertIRPRRatioPrev, winRatePrev: winRatePrev, earnings: earnings, upsell: upsell, crossSell: crossSell, lifetimeIRPR: lifetimeIRPR, lifetimeWinRate: lifetimeWinRate, hasCompletedProjects: (_k = expertMetricsData === null || expertMetricsData === void 0 ? void 0 : expertMetricsData.getExpertMetrics) === null || _k === void 0 ? void 0 : _k.lastProjectCompleted, lifetimeFSV: lifetimeFSV }),
|
|
225
225
|
react_1.default.createElement(core_1.Divider, { orientation: isSmallScreen ? 'horizontal' : 'vertical' })),
|
|
226
226
|
(estimatedAvailability !== '-' || nextMonthTrueAvailability !== '-' || expertFirms) && (react_1.default.createElement(core_1.Grid, { item: true, container: true, direction: 'column', justify: 'space-between', xs: 12, md: true, style: { flex: '1', width: 'auto' } },
|
|
227
227
|
react_1.default.createElement(TeamsSection_1.default, { estimatedAvailability: estimatedAvailability, nextMonthTrueAvailability: nextMonthTrueAvailability, expertFirms: expertFirms, firstName: firstName, lastName: lastName, primaryServiceLine: primaryServiceLine, city: city, stateAbbreviation: stateAbbreviation, paroTenure: paroTenure, imageUrl: imageUrl }),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ToastModalProps {
|
|
3
|
+
color: 'success' | 'info' | 'warning' | 'danger';
|
|
4
|
+
icon: string;
|
|
5
|
+
message: string;
|
|
6
|
+
duration?: number;
|
|
7
|
+
position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left';
|
|
8
|
+
}
|
|
9
|
+
declare const ToastModal: React.FC<ToastModalProps>;
|
|
10
|
+
export default ToastModal;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const core_1 = require("@material-ui/core");
|
|
28
|
+
const base_ui_1 = require("@paro.io/base-ui");
|
|
29
|
+
const ToastModal = ({ color, icon, message, duration = 6000, // Default duration is 6 seconds
|
|
30
|
+
position = 'bottom-right', }) => {
|
|
31
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
32
|
+
// Automatically open the modal on mount
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
setOpen(true);
|
|
35
|
+
// Automatically close the modal after the specified duration
|
|
36
|
+
const timer = setTimeout(() => {
|
|
37
|
+
setOpen(false);
|
|
38
|
+
}, duration);
|
|
39
|
+
// Cleanup the timeout if the component unmounts or if the duration changes
|
|
40
|
+
return () => clearTimeout(timer);
|
|
41
|
+
}, [duration]);
|
|
42
|
+
console.log("triggered");
|
|
43
|
+
return (react_1.default.createElement(core_1.Dialog, { open: open, onClose: () => setOpen(false), "aria-labelledby": "toast-modal-title", maxWidth: "xs", fullWidth: true, PaperProps: {
|
|
44
|
+
style: {
|
|
45
|
+
backgroundColor: '#323232', // Dark background to resemble toast style
|
|
46
|
+
color: '#fff', // White text
|
|
47
|
+
borderRadius: '8px',
|
|
48
|
+
display: 'flex',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
zIndex: 9999, // Ensure it’s on top of the MUI Dialog
|
|
52
|
+
position: 'absolute', // Absolute positioning to control location
|
|
53
|
+
top: position.includes('top') ? '10%' : 'auto',
|
|
54
|
+
bottom: position.includes('bottom') ? '10%' : 'auto',
|
|
55
|
+
right: position.includes('right') ? '10%' : 'auto',
|
|
56
|
+
left: position.includes('left') ? '10%' : 'auto',
|
|
57
|
+
},
|
|
58
|
+
} },
|
|
59
|
+
react_1.default.createElement(core_1.DialogContent, { style: { textAlign: 'center' } },
|
|
60
|
+
react_1.default.createElement(base_ui_1.Alert, { color: color, icon: icon, label: message, className: color === 'warning' ? 'bg-warning' : 'bg-success' }),
|
|
61
|
+
",")));
|
|
62
|
+
};
|
|
63
|
+
exports.default = ToastModal;
|