import React from 'react'
import { StyleSheet, ImageBackground } from 'react-native'
import { useUtils } from 'ordering-components/native'
import { Placeholder, PlaceholderLine } from 'rn-placeholder';
import { useTheme } from 'styled-components/native'
import { OText } from '../shared'
import {
CardContainer,
WrapImage,
WrapContent,
LineDivider
} from './styles'
export const PromotionCard = (props: any) => {
const {
promotion,
isLoading,
onPromotionClick,
} = props
const theme = useTheme();
const [{ optimizeImage, parseDate }] = useUtils();
return (
<>
onPromotionClick && onPromotionClick(promotion)}
>
{isLoading ? (
) : (
)}
{isLoading ? (
) : (
<>
{promotion?.name}
{!!promotion?.description && (
{promotion?.description}
)}
{`Expires ${parseDate(promotion?.end)}`}
>
)}
>
)
}
const styles = StyleSheet.create({
textStyle: {
// marginTop: 10,
},
image: {
width: '100%',
height: '100%',
}
})