import { styl } from 'cssxjs'
import { View, Text, Image } from 'react-native'
import { Card } from './Card'
import { Button } from './Button'
function ProductCard({ product }) {
return (
<Card
styleName="product-card"
title={product.name}
subtitle={`$${product.price}`}
actions={
<>
<Button variant="outline" size="small">Details</Button>
<Button variant="primary" size="small">Add to Cart</Button>
</>
}
>
<Image styleName="product-image" source={{ uri: product.image }} />
<Text styleName="description">{product.description}</Text>
</Card>
)
styl`
.product-card
max-width 320px
&:part(header)
background #667eea
padding 16px 20px
&:part(title)
color white
&:part(subtitle)
color rgba(255,255,255,0.8)
font-size 20px
font-weight 600
.product-image
width 100%
height 180px
border-radius 8px
.description
color #666
font-size 14px
line-height 22px
`
}