challenge-vtex-io-savio-car.../react/components/PaymentPix/PaymentPix.tsx

24 lines
467 B
TypeScript
Raw Normal View History

import React from "react";
import { useProduct } from "vtex.product-context";
const PaymentPix = () => {
const product = useProduct();
const pricePix = (
(product?.product?.priceRange.sellingPrice.highPrice || 0.0) * 0.9
).toFixed(2);
{
/*const imagePix =*/
}
const convertPrice = pricePix.toString().replace(".", ",");
return (
<div>
<p>R$ {convertPrice}</p>
<p>10% de desconto</p>
</div>
);
};
export { PaymentPix };