@finos/legend-application-marketplace
Version:
Legend Marketplace application core
27 lines • 2.37 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {} from 'react';
import { Button, Chip } from '@mui/material';
import { CheckCircleIcon, ShoppingCartIcon } from '@finos/legend-art';
import { LegendMarketplaceCard } from '../MarketplaceCard/LegendMarketplaceCard.js';
export const LegendMarketplaceProviderCard = (props) => {
const { providerResult, onAddToCartClick } = props;
const content = (_jsxs(_Fragment, { children: [_jsx("div", { className: "legend-marketplace-vendor-data-card__vendor-name", children: providerResult.providerName }), _jsx("div", { className: "legend-marketplace-vendor-data-card__product-name", children: providerResult.productName || 'N/A' }), _jsx("div", { className: "legend-marketplace-vendor-data-card__vendor-name__description", children: providerResult.description })] }));
const actions = providerResult.isOwned ? (_jsxs("div", { className: "legend-marketplace-vendor-data-card__vendor-name__owned", children: ["Already have access \u00A0 ", _jsx(CheckCircleIcon, {})] })) : (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "outlined", className: "legend-marketplace-vendor-data-card__add-to-cart-button", onClick: () => onAddToCartClick(providerResult), children: ["Add to cart \u00A0", _jsx(ShoppingCartIcon, {})] }), typeof providerResult.price === 'number' && (_jsx(Chip, { label: `$${providerResult.price.toFixed(2)} per month`, className: "legend-marketplace-vendor-data-card__price", sx: { color: 'white', backgroundColor: '#077d55' } }))] }));
return (_jsx(LegendMarketplaceCard, { size: "large", content: content, actions: actions, className: "legend-marketplace-vendor-data-card" }));
};
//# sourceMappingURL=LegendMarketplaceProviderCard.js.map