import React from "react"; import { useCssHandles } from "vtex.css-handles"; import { useProduct } from "vtex.product-context"; import "./styles.css"; const Pix = () => { const productContext = useProduct(); const price = productContext?.product?.priceRange.sellingPrice.highPrice; const CSS_HANDLES = [ "pix", "pixImage", "containerPix", "imagePix", "pricePix", "textPix", ]; const { handles } = useCssHandles(CSS_HANDLES); let pixPrice; if (price !== undefined) { const value = (price / 100) * 10; const valuePix = price - value; pixPrice = "R$ " + valuePix.toFixed(2).toString().replace(".", ","); } return (
{pixPrice}

10% de desconto

); }; export default Pix;