import { useRef } from 'react'; import PropTypes from 'prop-types'; import { getPrimaryBgColorClass, shouldForceWhiteTextLightDark, shouldForceWhiteTextLightMode } from '../ProductTheme'; import { clsm } from '../../../../../utils'; const ProductCardImage = ({ imageUrl, title, price, color, customClasses }) => { const imgRef = useRef(); const onErrorHandler = () => { imgRef.current.style.display = 'none'; }; return (
{title} {price && ( {price} )}
); }; ProductCardImage.defaultProps = { customClasses: '', color: 'default' }; ProductCardImage.propTypes = { customClasses: PropTypes.arrayOf(PropTypes.string), imageUrl: PropTypes.string.isRequired, price: PropTypes.string.isRequired, title: PropTypes.string.isRequired, color: PropTypes.string }; export default ProductCardImage;