2023-02-03 22:49:19 +00:00
|
|
|
import React from "react";
|
|
|
|
import { useProduct } from "vtex.product-context";
|
2023-02-01 00:45:35 +00:00
|
|
|
|
2023-02-03 22:49:19 +00:00
|
|
|
const Pix = () => {
|
|
|
|
const productContextValue = useProduct()?.product?.priceRange?.sellingPrice
|
|
|
|
?.highPrice;
|
2023-02-01 00:45:35 +00:00
|
|
|
|
2023-02-03 22:49:19 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div>
|
|
|
|
<img src="https://agenciamagma.vtexassets.com/arquivos/pix_izabela.svg" alt="Pix" />
|
|
|
|
{`R$ ${(productContextValue! - productContextValue! * 0.1)
|
|
|
|
.toFixed(2)
|
|
|
|
.replace(".", ",")}`
|
|
|
|
}
|
|
|
|
<p>
|
|
|
|
10% de desconto
|
|
|
|
</p>
|
|
|
|
</div>
|
2023-02-01 00:45:35 +00:00
|
|
|
|
2023-02-03 22:49:19 +00:00
|
|
|
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2023-02-01 00:45:35 +00:00
|
|
|
|
2023-02-03 22:49:19 +00:00
|
|
|
export default Pix;
|