import React, { ReactNode } from 'react'; import { Image as RNImage, StyleSheet } from 'react-native'; import { Text } from '../Text'; import { Box } from '../Box'; import { TouchableComponent } from '../TouchableComponent'; import { ImageSquare, Barcode } from 'phosphor-react-native'; import { Normalize } from '../../utils/normalize'; import type { Theme } from '../../theme/theme'; export interface IMiniProductCard { referenceName: string; packaging: string; sku?: string; image?: string; quantity?: number; currentQuantity?: number | null; onPress?: () => void; disabled?: boolean; spacing?: boolean; footerContent?: ReactNode; rightContent?: ReactNode; variantReference?: keyof Theme['textVariants']; variantPackaging?: keyof Theme['textVariants']; variantSku?: keyof Theme['textVariants']; } export const MiniProductCard = ({ referenceName, packaging, sku, quantity, currentQuantity, image, onPress, disabled = false, footerContent, rightContent, variantReference = 'body', variantPackaging = 'mediumBody', variantSku = 'mediumBody', }: IMiniProductCard) => { return ( {!image ? ( ) : ( )} {quantity != null ? ( {currentQuantity != null ? currentQuantity : quantity} ) : null} {currentQuantity != null && quantity != null && currentQuantity !== quantity ? ( {quantity} ) : null} {referenceName} {packaging} {sku ? ( {sku} ) : null} {footerContent} {rightContent} ); }; const styles = StyleSheet.create({ image: { width: '100%', aspectRatio: 1, resizeMode: 'contain', }, });