import type { Control, FieldName, FieldPath } from '@graphcommerce/ecommerce-ui' import { useWatch, type FieldValues } from '@graphcommerce/ecommerce-ui' import type { PriceTypeEnum } from '@graphcommerce/graphql-mesh' import { Money, type MoneyFragment } from '@graphcommerce/magento-store' import { sxx } from '@graphcommerce/next-ui' import { Box } from '@mui/material' import { useFormAddProductsToCart, type AddProductsToCartFields } from '../AddProductsToCart' type CustomizablePriceProps = { price_type: PriceTypeEnum | null | undefined productPrice: number name: FieldPath } & MoneyFragment export function CustomizablePrice(props: CustomizablePriceProps) { const { name, value, currency, price_type, productPrice } = props const { control } = useFormAddProductsToCart() const optionValue = !!useWatch({ control, name }) if (!value) return null return ( {/* Change fontFamily so the + is properly outlined */} +{'\u00A0'} ) }