@finos/legend-application-marketplace
Version:
Legend Marketplace application core
47 lines • 3.27 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { Fragment } from 'react';
import { Grid2, Typography } from '@mui/material';
import { GridTiemStatus, } from '../../../stores/lakehouse/LakehouseUtils.js';
import { clsx } from '@finos/legend-art';
export const GridItemsViewer = (props) => {
const gridDetails = props.details;
const title = props.title;
return (_jsxs(_Fragment, { children: [_jsx(Typography, { className: "marketplace-lakehouse-entitlements-grid-viewer__header", variant: "h6", sx: { marginBottom: '0.5rem' }, children: title }), _jsx(Grid2, { container: true, spacing: 0, sx: {
'--Grid-borderWidth': '1px',
borderTop: 'var(--Grid-borderWidth) solid',
borderLeft: 'var(--Grid-borderWidth) solid',
borderColor: 'divider',
'& > div': {
borderRight: 'var(--Grid-borderWidth) solid',
borderBottom: 'var(--Grid-borderWidth) solid',
borderColor: 'divider',
},
}, children: gridDetails.map((gridItem, index) => (_jsxs(Fragment, { children: [_jsx(Grid2, { container: false, size: 4, sx: {
alignContent: 'center',
backgroundColor: index % 2 === 0 ? '#f5f5f5' : 'white',
}, children: _jsx(Typography, { variant: "button", fontWeight: 'bold', sx: { fontSize: '14px', padding: '6px' }, children: gridItem.name }) }), _jsx(Grid2, { container: false, size: 8, sx: {
alignContent: 'center',
backgroundColor: index % 2 === 0 ? '#f5f5f5' : 'white',
}, children: _jsx(Typography, { variant: "subtitle1", sx: { fontSize: '14px', padding: '6px' }, className: clsx({
'marketplace-lakehouse-entitlements-grid-viewer__item-clickable-text': Boolean(gridItem.onClick),
'marketplace-lakehouse-entitlements-grid-viewer__status--success': gridItem.status === GridTiemStatus.SUCCESS,
'marketplace-lakehouse-entitlements-grid-viewer__status--error': gridItem.status === GridTiemStatus.ERROR,
'marketplace-lakehouse-entitlements-grid-viewer__status--in-progress': gridItem.status === GridTiemStatus.INFO,
}), onClick: () => gridItem.onClick?.(), children: gridItem.value }) })] }, gridItem.name))) })] }));
};
//# sourceMappingURL=GridItemViewer.js.map