/** * Copyright (c) 2026-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 { type JSX, type ReactNode } from 'react'; import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, } from '@mui/material'; import { ColumnFilterButton } from '../Filters/ColumnFilterButton.js'; import { CategoryChip } from './OrderProfileModalHeader.js'; import { formatItemPrice, OrderProfileTableHeader, } from './orderProfileUtils.js'; export const OrderProfileDetailTable = (props: { ariaLabel: string; categoryOptions: string[]; categoryFilter: Set; onCategoryFilterChange: (next: Set) => void; children: ReactNode; }): JSX.Element => { const { ariaLabel, categoryOptions, categoryFilter, onCategoryFilterChange, children, } = props; return ( {OrderProfileTableHeader.PRODUCT_NAME} {OrderProfileTableHeader.CATEGORY} {OrderProfileTableHeader.COST_MONTHLY} {children}
); }; export const OrderProfileDetailTableRow = (props: { productName: string; category: string; price: number; isTerminal: boolean; isSubItem?: boolean; rowModifierClass?: string; nameMetadata?: ReactNode; }): JSX.Element => { const { productName, category, price, isTerminal, isSubItem = false, rowModifierClass, nameMetadata, } = props; const rowAccentClass = isTerminal ? 'order-profile-modal__row-accent--vendor-profile' : 'order-profile-modal__row-accent--addon'; const nameWrapperClass = `order-profile-modal__product-name-wrapper${isSubItem ? ' order-profile-modal__product-name-wrapper--sub' : ''}`; const tableRowClassName = `order-profile-modal__table-row ${rowModifierClass ?? ''}`.trim(); return ( {productName} {nameMetadata} {formatItemPrice(price)} ); };