@monarkmarkets/marketplace 1.0.0 → 1.0.1

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.
@@ -0,0 +1,624 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { memo, useCallback, useMemo, useState, useEffect } from 'react';
3
+ import { __awaiter, __generator } from 'tslib';
4
+ import { Client } from '@monark-markets/api-client';
5
+
6
+ var CompanyLogo = /*#__PURE__*/memo(function (_a) {
7
+ var logoURL = _a.logoURL,
8
+ name = _a.name;
9
+ if (logoURL) {
10
+ return jsx("img", {
11
+ src: logoURL,
12
+ alt: "".concat(name, " logo"),
13
+ className: "w-8 h-8 rounded-lg object-cover"
14
+ });
15
+ }
16
+ return jsx("div", {
17
+ className: "w-8 h-8 bg-gray-100 rounded-lg flex items-center justify-center",
18
+ children: jsx("span", {
19
+ className: "text-gray-400 text-sm font-medium",
20
+ children: name.charAt(0)
21
+ })
22
+ });
23
+ });
24
+ CompanyLogo.displayName = 'CompanyLogo';
25
+
26
+ /**
27
+ * TableRow component renders a row in the IoITable component.
28
+ * It includes columns for company details, total funding, last round,
29
+ * price per share, and an action button to indicate interest.
30
+ */
31
+ var TableRow$1 = /*#__PURE__*/memo(function (_a) {
32
+ var _b, _c, _d;
33
+ var ColumnOne = _a.ColumnOne,
34
+ ColumnTwo = _a.ColumnTwo,
35
+ ColumnThree = _a.ColumnThree,
36
+ ColumnFour = _a.ColumnFour,
37
+ _e = _a.buttonText,
38
+ buttonText = _e === void 0 ? "" : _e,
39
+ investorId = _a.investorId;
40
+ _a.tableType;
41
+ var onButtonClick = _a.onButtonClick;
42
+ var handleButtonClick = useCallback(function (e) {
43
+ e.preventDefault();
44
+ onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick(ColumnOne.preIPOCompany.id, investorId);
45
+ }, [ColumnOne.preIPOCompany.id, investorId, onButtonClick]);
46
+ return jsxs("tr", {
47
+ className: "hover:bg-gray-50 transition-colors",
48
+ role: "row",
49
+ children: [jsx("td", {
50
+ className: "py-4 px-4 border-b border-gray-100",
51
+ role: "cell",
52
+ children: jsxs("div", {
53
+ className: "flex items-center gap-3",
54
+ children: [jsx(CompanyLogo, {
55
+ logoURL: ColumnOne.preIPOCompany.logoURL,
56
+ name: ColumnOne.name
57
+ }), jsxs("div", {
58
+ className: "flex flex-col",
59
+ children: [jsx("span", {
60
+ className: "font-medium text-gray-900",
61
+ children: ColumnOne.name
62
+ }), jsx("span", {
63
+ className: "text-sm text-gray-500",
64
+ children: ColumnOne.preIPOCompany.country
65
+ })]
66
+ })]
67
+ })
68
+ }), jsx("td", {
69
+ className: "py-4 px-4 border-b border-gray-100",
70
+ role: "cell",
71
+ children: jsx("span", {
72
+ className: "font-medium text-gray-900",
73
+ children: (_b = ColumnTwo === null || ColumnTwo === void 0 ? void 0 : ColumnTwo(ColumnOne)) !== null && _b !== void 0 ? _b : "N/A"
74
+ })
75
+ }), jsx("td", {
76
+ className: "py-4 px-4 border-b border-gray-100",
77
+ role: "cell",
78
+ children: jsx("span", {
79
+ className: "font-medium text-gray-900",
80
+ children: (_c = ColumnThree === null || ColumnThree === void 0 ? void 0 : ColumnThree(ColumnOne)) !== null && _c !== void 0 ? _c : "N/A"
81
+ })
82
+ }), jsx("td", {
83
+ className: "py-4 px-4 border-b border-gray-100",
84
+ role: "cell",
85
+ children: jsx("span", {
86
+ className: "font-medium text-gray-900",
87
+ children: (_d = ColumnFour === null || ColumnFour === void 0 ? void 0 : ColumnFour(ColumnOne)) !== null && _d !== void 0 ? _d : "N/A"
88
+ })
89
+ }), jsx("td", {
90
+ className: "py-4 px-4 border-b border-gray-100",
91
+ role: "cell",
92
+ children: jsx("button", {
93
+ onClick: handleButtonClick,
94
+ className: "bg-custom-blue hover:bg-custom-blue-dark text-white font-medium py-2 px-4 rounded-lg shadow-md transition-all duration-200",
95
+ "aria-label": "".concat(buttonText, " for ").concat(ColumnOne.name),
96
+ children: buttonText
97
+ })
98
+ })]
99
+ });
100
+ });
101
+ TableRow$1.displayName = 'TableRow';
102
+
103
+ /**
104
+ * Common TableHeader component that can be configured for different table types.
105
+ * It renders a header row with configurable column titles and styling.
106
+ *
107
+ * @param columns - Array of column configurations with titles and optional widths
108
+ */
109
+ var TableHeaders = /*#__PURE__*/memo(function (_a) {
110
+ var columns = _a.columns;
111
+ return jsx("thead", {
112
+ children: jsx("tr", {
113
+ className: "bg-gray-50 border-b border-gray-200",
114
+ role: "row",
115
+ children: columns.map(function (column, index) {
116
+ return jsx("th", {
117
+ className: "py-3 px-4 text-left text-sm font-semibold text-gray-900 ".concat(column.width || ''),
118
+ scope: "col",
119
+ role: "columnheader",
120
+ children: column.title
121
+ }, "".concat(column.title, "-").concat(index));
122
+ })
123
+ })
124
+ });
125
+ });
126
+ TableHeaders.displayName = 'TableHeader';
127
+
128
+ var NavigationButton = /*#__PURE__*/memo(function (_a) {
129
+ var onClick = _a.onClick,
130
+ disabled = _a.disabled,
131
+ direction = _a.direction;
132
+ return jsx("button", {
133
+ onClick: onClick,
134
+ disabled: disabled,
135
+ className: "p-2 rounded-lg text-gray-600 hover:bg-gray-100 disabled:opacity-50 disabled:hover:bg-transparent disabled:cursor-not-allowed transition-colors",
136
+ "aria-label": "".concat(direction, " page"),
137
+ children: jsx("svg", {
138
+ className: "w-5 h-5",
139
+ fill: "none",
140
+ stroke: "currentColor",
141
+ viewBox: "0 0 24 24",
142
+ xmlns: "http://www.w3.org/2000/svg",
143
+ children: jsx("path", {
144
+ strokeLinecap: "round",
145
+ strokeLinejoin: "round",
146
+ strokeWidth: 2,
147
+ d: direction === 'previous' ? "M15 19l-7-7 7-7" : "M9 5l7 7-7 7"
148
+ })
149
+ })
150
+ });
151
+ });
152
+ NavigationButton.displayName = 'NavigationButton';
153
+ var PageButton = /*#__PURE__*/memo(function (_a) {
154
+ var page = _a.page,
155
+ isCurrentPage = _a.isCurrentPage,
156
+ onClick = _a.onClick;
157
+ return jsx("button", {
158
+ onClick: onClick,
159
+ disabled: isCurrentPage,
160
+ className: "w-10 h-10 rounded-lg text-sm font-medium transition-colors ".concat(isCurrentPage ? 'bg-custom-blue text-white' : 'text-gray-600 hover:bg-gray-100'),
161
+ "aria-label": "Go to page ".concat(page),
162
+ "aria-current": isCurrentPage ? 'page' : undefined,
163
+ children: page
164
+ });
165
+ });
166
+ PageButton.displayName = 'PageButton';
167
+ /**
168
+ * Pagination component renders pagination controls for the IoITable component.
169
+ * It includes navigation buttons for previous and next pages, and page number buttons.
170
+ */
171
+ var Pagination = /*#__PURE__*/memo(function (_a) {
172
+ var currentPage = _a.currentPage,
173
+ totalPages = _a.totalPages,
174
+ onPageChange = _a.onPageChange;
175
+ var handlePrevious = useCallback(function () {
176
+ onPageChange(currentPage - 1);
177
+ }, [currentPage, onPageChange]);
178
+ var handleNext = useCallback(function () {
179
+ onPageChange(currentPage + 1);
180
+ }, [currentPage, onPageChange]);
181
+ var pageNumbers = useMemo(function () {
182
+ var pages = [];
183
+ var showEllipsis = totalPages > 7;
184
+ if (showEllipsis) {
185
+ if (currentPage <= 4) {
186
+ for (var i = 1; i <= 5; i++) {
187
+ pages.push(i);
188
+ }
189
+ pages.push('ellipsis');
190
+ pages.push(totalPages);
191
+ } else if (currentPage >= totalPages - 3) {
192
+ pages.push(1);
193
+ pages.push('ellipsis');
194
+ for (var i = totalPages - 4; i <= totalPages; i++) {
195
+ pages.push(i);
196
+ }
197
+ } else {
198
+ pages.push(1);
199
+ pages.push('ellipsis');
200
+ for (var i = currentPage - 1; i <= currentPage + 1; i++) {
201
+ pages.push(i);
202
+ }
203
+ pages.push('ellipsis');
204
+ pages.push(totalPages);
205
+ }
206
+ } else {
207
+ for (var i = 1; i <= totalPages; i++) {
208
+ pages.push(i);
209
+ }
210
+ }
211
+ return pages;
212
+ }, [currentPage, totalPages]);
213
+ return jsxs("nav", {
214
+ role: "navigation",
215
+ "aria-label": "Pagination",
216
+ className: "flex items-center justify-center gap-1",
217
+ children: [jsx(NavigationButton, {
218
+ onClick: handlePrevious,
219
+ disabled: currentPage <= 1,
220
+ direction: "previous"
221
+ }), jsx("div", {
222
+ className: "flex items-center gap-1 mx-2",
223
+ children: pageNumbers.map(function (page, index) {
224
+ return page === 'ellipsis' ? jsx("span", {
225
+ className: "w-10 h-10 flex items-center justify-center text-gray-500",
226
+ "aria-hidden": "true",
227
+ children: "..."
228
+ }, "ellipsis-".concat(index)) : jsx(PageButton, {
229
+ page: page,
230
+ isCurrentPage: page === currentPage,
231
+ onClick: function () {
232
+ return onPageChange(page);
233
+ }
234
+ }, page);
235
+ })
236
+ }), jsx(NavigationButton, {
237
+ onClick: handleNext,
238
+ disabled: currentPage >= totalPages,
239
+ direction: "next"
240
+ })]
241
+ });
242
+ });
243
+ Pagination.displayName = 'Pagination';
244
+
245
+ var formatLargeNumber = function (value) {
246
+ if (value >= 1000000000) {
247
+ return "$".concat((value / 1000000000).toFixed(1), "B");
248
+ } else if (value >= 1000000) {
249
+ return "$".concat((value / 1000000).toFixed(1), "M");
250
+ }
251
+ return "$".concat(value.toLocaleString());
252
+ };
253
+ var formatCurrency = function (value, decimals) {
254
+ if (decimals === void 0) {
255
+ decimals = 2;
256
+ }
257
+ if (value === undefined || value === null) return 'N/A';
258
+ return new Intl.NumberFormat('en-US', {
259
+ style: 'currency',
260
+ currency: 'USD',
261
+ maximumFractionDigits: decimals,
262
+ minimumFractionDigits: decimals
263
+ }).format(value);
264
+ };
265
+
266
+ var iotColumns = [{
267
+ title: 'Company',
268
+ width: 'w-1/3'
269
+ }, {
270
+ title: 'Total Funding'
271
+ }, {
272
+ title: 'Last Round'
273
+ }, {
274
+ title: 'Last Round Price/Share'
275
+ }, {
276
+ title: 'Indicate Interest'
277
+ }];
278
+ /**
279
+ * IoITable component displays a table of pre-IPO companies with pagination and loading states.
280
+ * It includes table headers, rows, and pagination controls.
281
+ */
282
+ var IoITable = function (_a) {
283
+ var companies = _a.companies,
284
+ investorId = _a.investorId,
285
+ onButtonClick = _a.onButtonClick,
286
+ _b = _a.buttonText,
287
+ buttonText = _b === void 0 ? "Submit IOI" : _b,
288
+ currentPage = _a.currentPage,
289
+ totalPages = _a.totalPages,
290
+ onPageChange = _a.onPageChange,
291
+ _c = _a.isLoading,
292
+ isLoading = _c === void 0 ? false : _c;
293
+ var LoadingSpinner = function () {
294
+ return jsxs("svg", {
295
+ className: "animate-spin h-8 w-8 text-custom-blue",
296
+ xmlns: "http://www.w3.org/2000/svg",
297
+ fill: "none",
298
+ viewBox: "0 0 24 24",
299
+ children: [jsx("circle", {
300
+ className: "opacity-25",
301
+ cx: "12",
302
+ cy: "12",
303
+ r: "10",
304
+ stroke: "currentColor",
305
+ strokeWidth: "4"
306
+ }), jsx("path", {
307
+ className: "opacity-75",
308
+ fill: "currentColor",
309
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
310
+ })]
311
+ });
312
+ };
313
+ if (!companies || companies.length === 0) {
314
+ return jsx("div", {
315
+ className: "bg-white rounded-lg shadow-sm p-8 text-center",
316
+ children: jsx("p", {
317
+ className: "text-gray-500",
318
+ children: "No companies available"
319
+ })
320
+ });
321
+ }
322
+ return jsxs("div", {
323
+ className: "space-y-4",
324
+ children: [jsxs("div", {
325
+ className: "relative",
326
+ children: [isLoading && jsx("div", {
327
+ className: "absolute inset-0 bg-white/50 flex items-center justify-center z-10",
328
+ children: jsx(LoadingSpinner, {})
329
+ }), jsx("div", {
330
+ className: "bg-white rounded-lg shadow-sm overflow-hidden",
331
+ children: jsxs("table", {
332
+ className: "w-full table-fixed",
333
+ children: [jsx(TableHeaders, {
334
+ columns: iotColumns
335
+ }), jsx("tbody", {
336
+ className: "relative",
337
+ children: companies.map(function (company) {
338
+ return jsx(TableRow$1, {
339
+ ColumnOne: {
340
+ preIPOCompany: company,
341
+ name: company.name || ''
342
+ },
343
+ ColumnTwo: function (company) {
344
+ return formatLargeNumber(company.preIPOCompany.totalFunding || 0);
345
+ },
346
+ ColumnThree: function (company) {
347
+ return company.preIPOCompany.lastFundingSeries ? "".concat(company.preIPOCompany.lastFundingSeries) : 'Unknown';
348
+ },
349
+ ColumnFour: function (company) {
350
+ return company.preIPOCompany.lastSharePrice ? "$".concat(company.preIPOCompany.lastSharePrice.toFixed(2)) : 'Not Available';
351
+ },
352
+ buttonText: buttonText,
353
+ investorId: investorId,
354
+ tableType: "private",
355
+ onButtonClick: onButtonClick
356
+ }, company.id);
357
+ })
358
+ })]
359
+ })
360
+ })]
361
+ }), jsx(Pagination, {
362
+ currentPage: currentPage,
363
+ totalPages: totalPages,
364
+ onPageChange: onPageChange
365
+ })]
366
+ });
367
+ };
368
+
369
+ var PreIPOCompanyService = /** @class */function () {
370
+ function PreIPOCompanyService() {
371
+ this._client = new Client("/api");
372
+ }
373
+ PreIPOCompanyService.prototype.GetCompanyLogoAndCountry = function (preIPOCompanyId) {
374
+ return __awaiter(this, void 0, void 0, function () {
375
+ var company, error_1;
376
+ return __generator(this, function (_a) {
377
+ switch (_a.label) {
378
+ case 0:
379
+ _a.trys.push([0, 2,, 3]);
380
+ return [4 /*yield*/, this._client.preIpoCompany(preIPOCompanyId)];
381
+ case 1:
382
+ company = _a.sent();
383
+ if (company) {
384
+ return [2 /*return*/, {
385
+ logoURL: company.logoURL || '',
386
+ location: company.country || 'Location not available'
387
+ }];
388
+ }
389
+ return [2 /*return*/, null];
390
+ case 2:
391
+ error_1 = _a.sent();
392
+ console.error("Failed to retrieve company logo and location for ID ".concat(preIPOCompanyId, ":"), error_1);
393
+ return [2 /*return*/, null];
394
+ case 3:
395
+ return [2 /*return*/];
396
+ }
397
+ });
398
+ });
399
+ };
400
+ return PreIPOCompanyService;
401
+ }();
402
+
403
+ /**
404
+ * TableRow component renders a row in the PrimaryTable component.
405
+ * It includes columns for company details, price per share, minimum investment,
406
+ * price per share, and an action to invest.
407
+ */
408
+ var TableRow = /*#__PURE__*/memo(function (_a) {
409
+ var _b, _c, _d;
410
+ var ColumnOne = _a.ColumnOne,
411
+ ColumnTwo = _a.ColumnTwo,
412
+ ColumnThree = _a.ColumnThree,
413
+ ColumnFour = _a.ColumnFour,
414
+ _e = _a.buttonText,
415
+ buttonText = _e === void 0 ? "" : _e,
416
+ investorId = _a.investorId,
417
+ onButtonClick = _a.onButtonClick;
418
+ var handleButtonClick = useCallback(function (e) {
419
+ e.preventDefault();
420
+ onButtonClick === null || onButtonClick === void 0 ? void 0 : onButtonClick(ColumnOne.preIPOCompanySpv.id, investorId);
421
+ }, [ColumnOne.preIPOCompanySpv.id, investorId, onButtonClick]);
422
+ var _f = useState(null),
423
+ companyDetails = _f[0],
424
+ setCompanyDetails = _f[1];
425
+ var _g = useState(true),
426
+ isLoading = _g[0],
427
+ setIsLoading = _g[1];
428
+ useEffect(function () {
429
+ var fetchCompanyDetails = function () {
430
+ return __awaiter(void 0, void 0, void 0, function () {
431
+ var service, details, error_1;
432
+ return __generator(this, function (_a) {
433
+ switch (_a.label) {
434
+ case 0:
435
+ setIsLoading(true);
436
+ service = new PreIPOCompanyService();
437
+ _a.label = 1;
438
+ case 1:
439
+ _a.trys.push([1, 3, 4, 5]);
440
+ return [4 /*yield*/, service.GetCompanyLogoAndCountry(ColumnOne.preIPOCompanySpv.preIPOCompanyId, investorId)];
441
+ case 2:
442
+ details = _a.sent();
443
+ setCompanyDetails(details);
444
+ return [3 /*break*/, 5];
445
+ case 3:
446
+ error_1 = _a.sent();
447
+ console.error('Error fetching company details:', error_1);
448
+ return [3 /*break*/, 5];
449
+ case 4:
450
+ setIsLoading(false);
451
+ return [7 /*endfinally*/];
452
+ case 5:
453
+ return [2 /*return*/];
454
+ }
455
+ });
456
+ });
457
+ };
458
+ fetchCompanyDetails();
459
+ }, [ColumnOne.preIPOCompanySpv.preIPOCompanyId, investorId]);
460
+ return jsxs("tr", {
461
+ className: "hover:bg-gray-50 transition-colors",
462
+ role: "row",
463
+ children: [jsx("td", {
464
+ className: "py-4 px-4 border-b border-gray-100",
465
+ role: "cell",
466
+ children: jsxs("div", {
467
+ className: "flex items-center gap-3",
468
+ children: [isLoading ? jsx("div", {
469
+ className: "w-8 h-8 animate-pulse bg-gray-200 rounded-lg"
470
+ }) : jsx(CompanyLogo, {
471
+ logoURL: companyDetails === null || companyDetails === void 0 ? void 0 : companyDetails.logoURL,
472
+ name: ColumnOne.name
473
+ }), jsxs("div", {
474
+ className: "flex flex-col",
475
+ children: [jsx("span", {
476
+ className: "font-medium text-gray-900",
477
+ children: ColumnOne.name
478
+ }), jsx("span", {
479
+ className: "text-sm text-gray-500",
480
+ children: isLoading ? jsx("div", {
481
+ className: "h-4 w-24 animate-pulse bg-gray-200 rounded"
482
+ }) : (companyDetails === null || companyDetails === void 0 ? void 0 : companyDetails.location) || 'Location not available'
483
+ })]
484
+ })]
485
+ })
486
+ }), jsx("td", {
487
+ className: "py-4 px-4 border-b border-gray-100",
488
+ role: "cell",
489
+ children: jsx("span", {
490
+ className: "font-medium text-gray-900",
491
+ children: (_b = ColumnTwo === null || ColumnTwo === void 0 ? void 0 : ColumnTwo(ColumnOne)) !== null && _b !== void 0 ? _b : "N/A"
492
+ })
493
+ }), jsx("td", {
494
+ className: "py-4 px-4 border-b border-gray-100",
495
+ role: "cell",
496
+ children: jsx("span", {
497
+ className: "font-medium text-gray-900",
498
+ children: (_c = ColumnThree === null || ColumnThree === void 0 ? void 0 : ColumnThree(ColumnOne)) !== null && _c !== void 0 ? _c : "N/A"
499
+ })
500
+ }), jsx("td", {
501
+ className: "py-4 px-4 border-b border-gray-100",
502
+ role: "cell",
503
+ children: jsx("span", {
504
+ className: "font-medium text-gray-900",
505
+ children: (_d = ColumnFour === null || ColumnFour === void 0 ? void 0 : ColumnFour(ColumnOne)) !== null && _d !== void 0 ? _d : "N/A"
506
+ })
507
+ }), jsx("td", {
508
+ className: "py-4 px-4 border-b border-gray-100",
509
+ role: "cell",
510
+ children: jsx("button", {
511
+ onClick: handleButtonClick,
512
+ className: "bg-custom-blue hover:bg-custom-blue-dark text-white font-medium py-2 px-4 rounded-lg shadow-md transition-all duration-200",
513
+ "aria-label": "".concat(buttonText, " for ").concat(ColumnOne.name),
514
+ children: buttonText
515
+ })
516
+ })]
517
+ });
518
+ });
519
+ TableRow.displayName = 'TableRow';
520
+
521
+ var primaryColumns = [{
522
+ title: 'Company',
523
+ width: 'w-1/3'
524
+ }, {
525
+ title: 'Price Per Share'
526
+ }, {
527
+ title: 'Minimum Investment'
528
+ }, {
529
+ title: 'Fees'
530
+ }, {
531
+ title: 'Invest'
532
+ }];
533
+ /**
534
+ * PrimaryTable component displays a table of SPV investment opportunities.
535
+ * It includes table headers and rows.
536
+ */
537
+ var PrimaryTable = function (_a) {
538
+ var companies = _a.companies,
539
+ investorId = _a.investorId,
540
+ onButtonClick = _a.onButtonClick,
541
+ _b = _a.buttonText,
542
+ buttonText = _b === void 0 ? "Invest" : _b,
543
+ _c = _a.isLoading,
544
+ isLoading = _c === void 0 ? false : _c,
545
+ currentPage = _a.currentPage,
546
+ totalPages = _a.totalPages,
547
+ onPageChange = _a.onPageChange;
548
+ var LoadingSpinner = function () {
549
+ return jsxs("svg", {
550
+ className: "animate-spin h-8 w-8 text-custom-blue",
551
+ xmlns: "http://www.w3.org/2000/svg",
552
+ fill: "none",
553
+ viewBox: "0 0 24 24",
554
+ children: [jsx("circle", {
555
+ className: "opacity-25",
556
+ cx: "12",
557
+ cy: "12",
558
+ r: "10",
559
+ stroke: "currentColor",
560
+ strokeWidth: "4"
561
+ }), jsx("path", {
562
+ className: "opacity-75",
563
+ fill: "currentColor",
564
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
565
+ })]
566
+ });
567
+ };
568
+ if (!companies || companies.length === 0) {
569
+ return jsx("div", {
570
+ className: "bg-white rounded-lg shadow-sm p-8 text-center",
571
+ children: jsx("p", {
572
+ className: "text-gray-500",
573
+ children: "No companies available"
574
+ })
575
+ });
576
+ }
577
+ return jsxs("div", {
578
+ className: "space-y-4",
579
+ children: [jsxs("div", {
580
+ className: "relative",
581
+ children: [isLoading && jsx("div", {
582
+ className: "absolute inset-0 bg-white/50 flex items-center justify-center z-10",
583
+ children: jsx(LoadingSpinner, {})
584
+ }), jsx("div", {
585
+ className: "bg-white rounded-lg shadow-sm overflow-hidden",
586
+ children: jsxs("table", {
587
+ className: "w-full table-fixed",
588
+ children: [jsx(TableHeaders, {
589
+ columns: primaryColumns
590
+ }), jsx("tbody", {
591
+ className: "relative",
592
+ children: companies.map(function (company) {
593
+ return jsx(TableRow, {
594
+ ColumnOne: {
595
+ preIPOCompanySpv: company,
596
+ name: company.name || ''
597
+ },
598
+ ColumnTwo: function (company) {
599
+ return formatCurrency(company.preIPOCompanySpv.allInPricePerShare || 0);
600
+ },
601
+ ColumnThree: function (company) {
602
+ return company.preIPOCompanySpv.minCommitmentAmount ? formatCurrency(company.preIPOCompanySpv.minCommitmentAmount) : 'Unknown';
603
+ },
604
+ ColumnFour: function (company) {
605
+ return company.preIPOCompanySpv.managementFee ? "".concat(company.preIPOCompanySpv.managementFee, "%") : 'Not Available';
606
+ },
607
+ buttonText: buttonText,
608
+ investorId: investorId,
609
+ onButtonClick: onButtonClick
610
+ }, company.id);
611
+ })
612
+ })]
613
+ })
614
+ })]
615
+ }), jsx(Pagination, {
616
+ currentPage: currentPage,
617
+ totalPages: totalPages,
618
+ onPageChange: onPageChange
619
+ })]
620
+ });
621
+ };
622
+
623
+ export { IoITable, PrimaryTable };
624
+ //# sourceMappingURL=index.esm.js.map