import { Product } from "@/lib/product" import { ImageBackground, StyleProp, StyleSheet, Text, ViewStyle } from "react-native"; import { AnimatedStyle } from "react-native-reanimated"; import { View } from "react-native-reanimated/lib/typescript/Animated"; export type OnProductSelectedFunc = (product : Product) => any; type MyStyle = StyleProp>>; export type ProductTileProps = { product: (Product), onProductSelected?: OnProductSelectedFunc, style?: { tile?: MyStyle, image?: MyStyle, } } const FALLBACK_IMAGE = ""; export function ProductTile ({product, onProductSelected, style} : ProductTileProps) { const src = product.attributes.image || FALLBACK_IMAGE; return ( {product.attributes.name || `Product ${product.id}`} { product.pricePerUnit.toString() } / {product.measure.value} {product.measure.unit.symbol} ); } const styles = StyleSheet.create({ image: { }, text: { }, })