import React, { FC } from 'react' import { Text, Box } from '@vtex/store-ui' import { useItemContext } from './ItemContext' import { opaque } from './utils/opaque' import { TextAlignProp } from './utils/textAlign' import { FormattedPrice } from '../FormattedPrice/FormattedPrice' import { FormattedCurrency } from '../FormattedCurrency/FormattedCurrency' type PriceProps = TextAlignProp & { showListPrice?: boolean } export const ProductItemPrice: FC = ({ textAlign = 'left', showListPrice = true, }) => { const { item, loading } = useItemContext() if (loading) { return <>loading... } return ( {item.listPrice && item.listPrice !== item.price && showListPrice && ( )} ) }