import React from 'react'
import { PriceWrapper, SalePrice, RegularPrice } from './styled'
import { ProductPriceProps } from './typings'
function defaultRenderSalePrice(props: ProductPriceProps) {
return <SalePrice aria-label="sale-price">{props.salePrice}</SalePrice>
}
function defaultRenderRegularPrice(props: ProductPriceProps) {
return (
<RegularPrice aria-label="regular-price" isSalePrice={props.isSalePrice}>{props.regularPrice}</RegularPrice>
)
}
function defaultRenderWrapper(props: ProductPriceProps) {
const { className, children } = props
const passthroughProps = Object.freeze({
className,
'data-qa': props['data-qa']
})
return (
<PriceWrapper aria-label="product-price" {...passthroughProps}>{children}</PriceWrapper>
)
}
export {
defaultRenderWrapper,
defaultRenderSalePrice,
defaultRenderRegularPrice,
}