@finos/legend-application-marketplace 0.2.19 → 0.2.21

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 (71) hide show
  1. package/lib/application/LegendMarketplaceApplicationConfig.d.ts +6 -3
  2. package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -1
  3. package/lib/application/LegendMarketplaceApplicationConfig.js +13 -4
  4. package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -1
  5. package/lib/components/Pagination/PaginationControls.d.ts.map +1 -1
  6. package/lib/components/Pagination/PaginationControls.js +2 -2
  7. package/lib/components/Pagination/PaginationControls.js.map +1 -1
  8. package/lib/components/ProviderCard/LegendMarketplaceOrderProfileCard.d.ts +23 -0
  9. package/lib/components/ProviderCard/LegendMarketplaceOrderProfileCard.d.ts.map +1 -0
  10. package/lib/components/ProviderCard/LegendMarketplaceOrderProfileCard.js +93 -0
  11. package/lib/components/ProviderCard/LegendMarketplaceOrderProfileCard.js.map +1 -0
  12. package/lib/components/ProviderCard/LegendMarketplaceTerminalCard.d.ts.map +1 -1
  13. package/lib/components/ProviderCard/LegendMarketplaceTerminalCard.js +5 -11
  14. package/lib/components/ProviderCard/LegendMarketplaceTerminalCard.js.map +1 -1
  15. package/lib/components/ProviderCard/OrderProfileDetailModal.d.ts +26 -0
  16. package/lib/components/ProviderCard/OrderProfileDetailModal.d.ts.map +1 -0
  17. package/lib/components/ProviderCard/OrderProfileDetailModal.js +36 -0
  18. package/lib/components/ProviderCard/OrderProfileDetailModal.js.map +1 -0
  19. package/lib/components/ProviderCard/OrderProfileMultiselectModal.d.ts +26 -0
  20. package/lib/components/ProviderCard/OrderProfileMultiselectModal.d.ts.map +1 -0
  21. package/lib/components/ProviderCard/OrderProfileMultiselectModal.js +31 -0
  22. package/lib/components/ProviderCard/OrderProfileMultiselectModal.js.map +1 -0
  23. package/lib/components/ProviderCard/orderProfileUtils.d.ts +71 -0
  24. package/lib/components/ProviderCard/orderProfileUtils.d.ts.map +1 -0
  25. package/lib/components/ProviderCard/orderProfileUtils.js +122 -0
  26. package/lib/components/ProviderCard/orderProfileUtils.js.map +1 -0
  27. package/lib/index.css +2 -2
  28. package/lib/index.css.map +1 -1
  29. package/lib/package.json +1 -1
  30. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.d.ts.map +1 -1
  31. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js +3 -0
  32. package/lib/pages/Lakehouse/entitlements/PermitDataAccessRequest.js.map +1 -1
  33. package/lib/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.d.ts.map +1 -1
  34. package/lib/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.js +42 -9
  35. package/lib/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.js.map +1 -1
  36. package/lib/stores/LegendMarketPlaceVendorDataStore.d.ts +6 -2
  37. package/lib/stores/LegendMarketPlaceVendorDataStore.d.ts.map +1 -1
  38. package/lib/stores/LegendMarketPlaceVendorDataStore.js +25 -2
  39. package/lib/stores/LegendMarketPlaceVendorDataStore.js.map +1 -1
  40. package/lib/stores/LegendMarketplaceBaseStore.d.ts +1 -1
  41. package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -1
  42. package/lib/stores/LegendMarketplaceBaseStore.js +10 -5
  43. package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -1
  44. package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts +10 -0
  45. package/lib/stores/ai/LegendMarketplaceAIChatStore.d.ts.map +1 -1
  46. package/lib/stores/ai/LegendMarketplaceAIChatStore.js +115 -50
  47. package/lib/stores/ai/LegendMarketplaceAIChatStore.js.map +1 -1
  48. package/lib/stores/cart/CartStore.d.ts +14 -2
  49. package/lib/stores/cart/CartStore.d.ts.map +1 -1
  50. package/lib/stores/cart/CartStore.js +68 -5
  51. package/lib/stores/cart/CartStore.js.map +1 -1
  52. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts +2 -1
  53. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.d.ts.map +1 -1
  54. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js +8 -3
  55. package/lib/stores/lakehouse/entitlements/EntitlementsDashboardState.js.map +1 -1
  56. package/package.json +10 -10
  57. package/src/application/LegendMarketplaceApplicationConfig.ts +19 -11
  58. package/src/components/Pagination/PaginationControls.tsx +19 -17
  59. package/src/components/ProviderCard/LegendMarketplaceOrderProfileCard.tsx +246 -0
  60. package/src/components/ProviderCard/LegendMarketplaceTerminalCard.tsx +9 -16
  61. package/src/components/ProviderCard/OrderProfileDetailModal.tsx +224 -0
  62. package/src/components/ProviderCard/OrderProfileMultiselectModal.tsx +142 -0
  63. package/src/components/ProviderCard/orderProfileUtils.ts +165 -0
  64. package/src/pages/Lakehouse/entitlements/PermitDataAccessRequest.tsx +3 -0
  65. package/src/pages/TerminalsAddons/LegendMarketplaceTerminalsAddons.tsx +170 -21
  66. package/src/stores/LegendMarketPlaceVendorDataStore.tsx +33 -1
  67. package/src/stores/LegendMarketplaceBaseStore.ts +13 -9
  68. package/src/stores/ai/LegendMarketplaceAIChatStore.ts +273 -69
  69. package/src/stores/cart/CartStore.ts +90 -4
  70. package/src/stores/lakehouse/entitlements/EntitlementsDashboardState.ts +10 -1
  71. package/tsconfig.json +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-marketplace",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "description": "Legend Marketplace application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,16 +45,16 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@finos/legend-application": "16.0.110",
49
- "@finos/legend-art": "7.1.151",
50
- "@finos/legend-code-editor": "2.0.176",
51
- "@finos/legend-extension-dsl-data-product": "0.0.86",
52
- "@finos/legend-extension-dsl-data-space": "10.4.225",
53
- "@finos/legend-graph": "32.6.8",
54
- "@finos/legend-lego": "2.0.196",
48
+ "@finos/legend-application": "16.0.112",
49
+ "@finos/legend-art": "7.1.153",
50
+ "@finos/legend-code-editor": "2.0.178",
51
+ "@finos/legend-extension-dsl-data-product": "0.0.88",
52
+ "@finos/legend-extension-dsl-data-space": "10.4.227",
53
+ "@finos/legend-graph": "32.6.9",
54
+ "@finos/legend-lego": "2.0.198",
55
55
  "@finos/legend-server-depot": "6.1.12",
56
- "@finos/legend-server-lakehouse": "0.3.57",
57
- "@finos/legend-server-marketplace": "0.1.72",
56
+ "@finos/legend-server-lakehouse": "0.3.58",
57
+ "@finos/legend-server-marketplace": "0.1.73",
58
58
  "@finos/legend-shared": "11.0.25",
59
59
  "@finos/legend-storage": "3.0.146",
60
60
  "@mui/material": "7.3.4",
@@ -48,6 +48,9 @@ class LegendMarketplaceApplicationCoreOptions {
48
48
  newsletterUrl: string | undefined;
49
49
  historicalNewsletterUrl: string | undefined;
50
50
 
51
+ generalInquiriesUrl: string | undefined;
52
+ requestInternalAppUrl: string | undefined;
53
+
51
54
  /**
52
55
  * Used for any features that are still in development
53
56
  */
@@ -79,6 +82,8 @@ class LegendMarketplaceApplicationCoreOptions {
79
82
  ),
80
83
  ),
81
84
  historicalNewsletterUrl: optional(primitive()),
85
+ generalInquiriesUrl: optional(primitive()),
86
+ requestInternalAppUrl: optional(primitive()),
82
87
  defaultSearchSuggestions: optional(list(primitive())),
83
88
  defaultAISuggestedQueries: optional(list(primitive())),
84
89
  }),
@@ -123,9 +128,9 @@ export interface LegendMarketplaceApplicationConfigurationData
123
128
  };
124
129
  lakehouse?: {
125
130
  url: string;
126
- platformUrl: string;
131
+ platformUrl?: string;
127
132
  workflowUrl: string;
128
- permitWorkflowUrl: string;
133
+ permitWorkflowUrl?: string;
129
134
  entitlements: {
130
135
  applicationDirectoryUrl: string;
131
136
  applicationIDUrl: string;
@@ -158,6 +163,7 @@ export interface LegendMarketplaceApplicationConfigurationData
158
163
  enabled: boolean;
159
164
  llmServiceUrl?: string;
160
165
  llmModelName?: string;
166
+ llmModelOptions?: string[];
161
167
  sqlExecutionUrl?: string;
162
168
  orchestratorUrl?: string;
163
169
  orchestratorAuthToken?: string;
@@ -197,7 +203,7 @@ export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig
197
203
  readonly lakehouseServerUrl: string;
198
204
  readonly lakehousePlatformUrl: string;
199
205
  readonly lakehouseWorkflowServerUrl: string;
200
- readonly lakehousePermitWorkflowServerUrl: string;
206
+ readonly lakehousePermitWorkflowServerUrl: string | undefined;
201
207
  readonly lakehouseEntitlementsConfig:
202
208
  | LegendLakehouseEntitlementsConfig
203
209
  | undefined;
@@ -353,13 +359,12 @@ export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig
353
359
  `Can't configure application: 'lakehouse.workflowUrl' field is missing or empty`,
354
360
  ),
355
361
  );
356
- this.lakehousePermitWorkflowServerUrl =
357
- LegendApplicationConfig.resolveAbsoluteUrl(
358
- guaranteeNonEmptyString(
362
+ this.lakehousePermitWorkflowServerUrl = input.configData.lakehouse
363
+ .permitWorkflowUrl
364
+ ? LegendApplicationConfig.resolveAbsoluteUrl(
359
365
  input.configData.lakehouse.permitWorkflowUrl,
360
- `Can't configure application: 'lakehouse.permitWorkflowUrl' field is missing or empty`,
361
- ),
362
- );
366
+ )
367
+ : undefined;
363
368
  this.lakehouseEntitlementsConfig = new LegendLakehouseEntitlementsConfig(
364
369
  guaranteeNonEmptyString(
365
370
  input.configData.lakehouse.entitlements.applicationDirectoryUrl,
@@ -452,7 +457,7 @@ export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig
452
457
 
453
458
  private static buildLegendAIConfig(
454
459
  legendAIData: LegendMarketplaceApplicationConfigurationData['legendAI'],
455
- marketplaceServerUrl: string,
460
+ marketplaceSearchUrl: string,
456
461
  engineServerUrl: string,
457
462
  dataProductEnv: LegendMarketplaceEnv,
458
463
  ): LegendAIConfig {
@@ -464,13 +469,16 @@ export class LegendMarketplaceApplicationConfig extends LegendApplicationConfig
464
469
  enabled: legendAIData.enabled,
465
470
  llmServiceUrl: legendAIData.llmServiceUrl,
466
471
  llmModelName: legendAIData.llmModelName,
472
+ ...(legendAIData.llmModelOptions === undefined
473
+ ? {}
474
+ : { llmModelOptions: legendAIData.llmModelOptions }),
467
475
  sqlExecutionUrl: legendAIData.sqlExecutionUrl,
468
476
  orchestratorUrl: legendAIData.orchestratorUrl
469
477
  ? LegendApplicationConfig.resolveAbsoluteUrl(
470
478
  legendAIData.orchestratorUrl,
471
479
  )
472
480
  : undefined,
473
- marketplaceSearchUrl: marketplaceServerUrl,
481
+ marketplaceSearchUrl,
474
482
  engineUrl: engineServerUrl,
475
483
  ...(legendAIData.orchestratorAuthToken === undefined
476
484
  ? {}
@@ -93,23 +93,25 @@ export const PaginationControls = observer(
93
93
  </Box>
94
94
 
95
95
  <Box className="legend-marketplace-pagination-controls">
96
- <Pagination
97
- count={totalPages}
98
- page={page}
99
- onChange={handlePageChange}
100
- color="primary"
101
- showFirstButton={true}
102
- showLastButton={true}
103
- disabled={disabled}
104
- siblingCount={1}
105
- boundaryCount={2}
106
- size="large"
107
- sx={{
108
- '& .MuiPaginationItem-root': {
109
- fontSize: '1.5rem',
110
- },
111
- }}
112
- />
96
+ {totalPages > 1 && (
97
+ <Pagination
98
+ count={totalPages}
99
+ page={page}
100
+ onChange={handlePageChange}
101
+ color="primary"
102
+ showFirstButton={true}
103
+ showLastButton={true}
104
+ disabled={disabled}
105
+ siblingCount={1}
106
+ boundaryCount={2}
107
+ size="large"
108
+ sx={{
109
+ '& .MuiPaginationItem-root': {
110
+ fontSize: '1.5rem',
111
+ },
112
+ }}
113
+ />
114
+ )}
113
115
  </Box>
114
116
  </Box>
115
117
  );
@@ -0,0 +1,246 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { type JSX, useState } from 'react';
18
+ import {
19
+ Box,
20
+ Button,
21
+ Card,
22
+ CardActionArea,
23
+ CardActions,
24
+ CardContent,
25
+ CardMedia,
26
+ Chip,
27
+ CircularProgress,
28
+ IconButton,
29
+ Typography,
30
+ } from '@mui/material';
31
+ import {
32
+ CheckCircleIcon,
33
+ InfoCircleIcon,
34
+ ShoppingCartIcon,
35
+ } from '@finos/legend-art';
36
+ import type {
37
+ TraderProfile,
38
+ TraderProfileItem,
39
+ } from '@finos/legend-server-marketplace';
40
+ import { useLegendMarketplaceBaseStore } from '../../application/providers/LegendMarketplaceFrameworkProvider.js';
41
+ import { observer } from 'mobx-react-lite';
42
+ import { flowResult } from 'mobx';
43
+ import { toastManager } from '../Toast/CartToast.js';
44
+ import { assertErrorThrown } from '@finos/legend-shared';
45
+ import { OrderProfileDetailModal } from './OrderProfileDetailModal.js';
46
+ import { OrderProfileMultiselectModal } from './OrderProfileMultiselectModal.js';
47
+ import {
48
+ calculateMultiselectTotalPrice,
49
+ formatAddToCartErrorMessage,
50
+ formatAddToCartSuccessMessage,
51
+ formatCardPrice,
52
+ formatProfileSummaryLine,
53
+ getItemSummary,
54
+ getRandomImageUrl,
55
+ OrderProfileLabel,
56
+ } from './orderProfileUtils.js';
57
+
58
+ export const LegendMarketplaceOrderProfileCard = observer(
59
+ (props: { traderProfile: TraderProfile }): JSX.Element => {
60
+ const { traderProfile } = props;
61
+ const [isAddingToCart, setIsAddingToCart] = useState(false);
62
+ const [showDetailModal, setShowDetailModal] = useState(false);
63
+ const [showMultiselectModal, setShowMultiselectModal] = useState(false);
64
+
65
+ const legendMarketplaceBaseStore = useLegendMarketplaceBaseStore();
66
+ const { cartStore, applicationStore } = legendMarketplaceBaseStore;
67
+ const assetUrl = applicationStore.config.assetsBaseUrl;
68
+
69
+ const [imageUrl] = useState(() => getRandomImageUrl(assetUrl));
70
+
71
+ const items = traderProfile.items;
72
+ const { terminalCount, addOnCount } = getItemSummary(items);
73
+
74
+ const multiselectTotalPrice = traderProfile.multiselect
75
+ ? calculateMultiselectTotalPrice(items)
76
+ : undefined;
77
+
78
+ const displayPrice = traderProfile.multiselect
79
+ ? (multiselectTotalPrice ?? traderProfile.price)
80
+ : traderProfile.price;
81
+
82
+ const isInCart = cartStore.isOrderProfileInCart(traderProfile);
83
+
84
+ const executeCartAction = async (
85
+ action: () => Promise<void>,
86
+ ): Promise<void> => {
87
+ setIsAddingToCart(true);
88
+ try {
89
+ await action();
90
+ toastManager.success(
91
+ formatAddToCartSuccessMessage(traderProfile.productName),
92
+ );
93
+ } catch (error) {
94
+ assertErrorThrown(error);
95
+ toastManager.error(
96
+ formatAddToCartErrorMessage(traderProfile.productName, error.message),
97
+ );
98
+ } finally {
99
+ setIsAddingToCart(false);
100
+ }
101
+ };
102
+
103
+ const handleAddToCart = (): void => {
104
+ if (traderProfile.isOwned) {
105
+ return;
106
+ }
107
+ if (traderProfile.multiselect) {
108
+ setShowMultiselectModal(true);
109
+ return;
110
+ }
111
+ const terminals = items.filter((item) => item.isTerminal);
112
+ const addOns = items.filter((item) => !item.isTerminal);
113
+ executeCartAction(async () => {
114
+ await flowResult(cartStore.addOrderProfileItemsToCart(terminals, true));
115
+ await flowResult(cartStore.addOrderProfileItemsToCart(addOns, true));
116
+ }).catch(applicationStore.alertUnhandledError);
117
+ };
118
+
119
+ const handleMultiselectConfirm = (
120
+ selectedTerminals: TraderProfileItem[],
121
+ ): void => {
122
+ setShowMultiselectModal(false);
123
+ const selectedModel = selectedTerminals[0]?.model ?? null;
124
+ const addOnItems = items.filter(
125
+ (item) =>
126
+ !item.isTerminal &&
127
+ !item.isOwned &&
128
+ (selectedModel === null || item.model === selectedModel),
129
+ );
130
+ executeCartAction(async () => {
131
+ await flowResult(
132
+ cartStore.addOrderProfileItemsToCart(selectedTerminals, true),
133
+ );
134
+ await flowResult(
135
+ cartStore.addOrderProfileItemsToCart(addOnItems, true),
136
+ );
137
+ }).catch(applicationStore.alertUnhandledError);
138
+ };
139
+
140
+ return (
141
+ <>
142
+ <Card className="legend-marketplace-terminal-card legend-marketplace-order-profile-card">
143
+ <CardActionArea className="legend-marketplace-terminal-card__action">
144
+ <CardMedia
145
+ component="img"
146
+ className="legend-marketplace-terminal-card__image"
147
+ height="140"
148
+ image={imageUrl}
149
+ alt="order profile"
150
+ />
151
+ <Chip
152
+ label={OrderProfileLabel.CHIP_LABEL}
153
+ className="legend-marketplace-terminal-card__category-chip"
154
+ />
155
+ <CardContent className="legend-marketplace-terminal-card__content">
156
+ <Typography
157
+ variant="subtitle2"
158
+ className="legend-marketplace-terminal-card__provider legend-marketplace-order-profile-card__summary"
159
+ >
160
+ {formatProfileSummaryLine(terminalCount, addOnCount)}
161
+ </Typography>
162
+ <Box className="legend-marketplace-order-profile-card__title-row">
163
+ <Typography
164
+ variant="h6"
165
+ className="legend-marketplace-terminal-card__title"
166
+ >
167
+ {traderProfile.productName.toUpperCase()}
168
+ </Typography>
169
+ <IconButton
170
+ size="small"
171
+ onClick={(e) => {
172
+ e.stopPropagation();
173
+ setShowDetailModal(true);
174
+ }}
175
+ className="legend-marketplace-order-profile-card__info-button"
176
+ aria-label="View profile details"
177
+ >
178
+ <InfoCircleIcon />
179
+ </IconButton>
180
+ </Box>
181
+ </CardContent>
182
+ </CardActionArea>
183
+
184
+ <CardActions className="legend-marketplace-terminal-card__action-buttons">
185
+ {traderProfile.isOwned ? (
186
+ <Box className="legend-marketplace-terminal-card__owned-access">
187
+ {OrderProfileLabel.ALREADY_HAVE_ACCESS} &nbsp;
188
+ <CheckCircleIcon />
189
+ </Box>
190
+ ) : (
191
+ <>
192
+ <Button
193
+ variant="outlined"
194
+ className="legend-marketplace-terminal-card__add-to-cart-button"
195
+ onClick={handleAddToCart}
196
+ disabled={isAddingToCart || isInCart}
197
+ >
198
+ {isAddingToCart && (
199
+ <>
200
+ {OrderProfileLabel.ADDING} &nbsp;
201
+ <CircularProgress size={16} />
202
+ </>
203
+ )}
204
+ {!isAddingToCart && isInCart && (
205
+ <>
206
+ {OrderProfileLabel.IN_CART} &nbsp;
207
+ <Box className="legend-marketplace-terminal-card__in-cart-check">
208
+ <CheckCircleIcon />
209
+ </Box>
210
+ </>
211
+ )}
212
+ {!isAddingToCart && !isInCart && (
213
+ <>
214
+ {OrderProfileLabel.ADD_TO_CART} &nbsp;
215
+ <ShoppingCartIcon />
216
+ </>
217
+ )}
218
+ </Button>
219
+ <Chip
220
+ label={formatCardPrice(displayPrice)}
221
+ className="legend-marketplace-terminal-card__price"
222
+ />
223
+ </>
224
+ )}
225
+ </CardActions>
226
+ </Card>
227
+
228
+ <OrderProfileDetailModal
229
+ profile={traderProfile}
230
+ open={showDetailModal}
231
+ onClose={() => setShowDetailModal(false)}
232
+ {...(multiselectTotalPrice !== undefined
233
+ ? { multiselectTotalPrice }
234
+ : {})}
235
+ />
236
+
237
+ <OrderProfileMultiselectModal
238
+ profile={traderProfile}
239
+ open={showMultiselectModal}
240
+ onClose={() => setShowMultiselectModal(false)}
241
+ onConfirm={handleMultiselectConfirm}
242
+ />
243
+ </>
244
+ );
245
+ },
246
+ );
@@ -144,14 +144,7 @@ export const LegendMarketplaceTerminalCard = observer(
144
144
  </CardActionArea>
145
145
  <CardActions className="legend-marketplace-terminal-card__action-buttons">
146
146
  {terminalResult.isOwned ? (
147
- <Box
148
- sx={{
149
- display: 'flex',
150
- alignItems: 'center',
151
- color: '#077D55',
152
- fontWeight: 'bold',
153
- }}
154
- >
147
+ <Box className="legend-marketplace-terminal-card__owned-access">
155
148
  Already have access &nbsp;
156
149
  <CheckCircleIcon />
157
150
  </Box>
@@ -165,19 +158,21 @@ export const LegendMarketplaceTerminalCard = observer(
165
158
  }}
166
159
  disabled={isAddingToCart || isInCart}
167
160
  >
168
- {isAddingToCart ? (
161
+ {isAddingToCart && (
169
162
  <>
170
163
  Adding... &nbsp;
171
164
  <CircularProgress size={16} />
172
165
  </>
173
- ) : isInCart ? (
166
+ )}
167
+ {!isAddingToCart && isInCart && (
174
168
  <>
175
169
  In Cart &nbsp;
176
- <Box sx={{ color: '#077D55', display: 'inline-flex' }}>
170
+ <Box className="legend-marketplace-terminal-card__in-cart-check">
177
171
  <CheckCircleIcon />
178
172
  </Box>
179
173
  </>
180
- ) : (
174
+ )}
175
+ {!isAddingToCart && !isInCart && (
181
176
  <>
182
177
  Add to cart &nbsp;
183
178
  <ShoppingCartIcon />
@@ -189,12 +184,10 @@ export const LegendMarketplaceTerminalCard = observer(
189
184
  label={`${new Intl.NumberFormat('en-US', {
190
185
  style: 'currency',
191
186
  currency: 'USD',
192
- roundingIncrement: 1,
193
- minimumFractionDigits: 0,
194
- maximumFractionDigits: 0,
187
+ minimumFractionDigits: 2,
188
+ maximumFractionDigits: 2,
195
189
  }).format(terminalResult.price)}/month`}
196
190
  className="legend-marketplace-terminal-card__price"
197
- sx={{ color: 'white', backgroundColor: '#077d55' }}
198
191
  />
199
192
  )}
200
193
  </>