import * as React from 'react'; import get from 'lodash/get'; import min from 'lodash/min'; import { useObservableState } from 'observable-hooks'; import Box from '@wcpos/components/src/box'; import Image from '@wcpos/components/src/image'; import { useImageAttachment } from '../../hooks/use-image-attachment'; type Props = { item: import('@wcpos/database').ProductVariationDocument; cellWidth: number; }; export const ProductVariationImage = ({ item: product, cellWidth }: Props) => { const image = useObservableState(product.image$, product.image); const imageURL = get(image, 'src', undefined); const source = useImageAttachment(product, imageURL); return ( } /> ); };