import { Product } from "@/lib/product" import { ImageBackground, StyleProp, StyleSheet, Text, View, ViewStyle } from "react-native"; import { AnimatedStyle } from "react-native-reanimated"; 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.priceDisplay } ); } const styles = StyleSheet.create({ image: { }, text: { }, tile: { }, })