import React from 'react' import { useProduct } from 'vtex.product-context' // import { useCssHandles } from 'vtex.css-handles' import styles from "./styles.css" const Pix = () => { const product = useProduct() let pixValueTotal:any = product?.product?.priceRange?.sellingPrice?.lowPrice; let pixValueTotalNumber = parseFloat(pixValueTotal); let porcentagemDesconto = 10; let desconto = (pixValueTotalNumber / 100)* porcentagemDesconto; let pixValueDesconto = (pixValueTotal - desconto).toFixed(2); let pixValueDescontoVirgula = pixValueDesconto.replace(".", ",") // const CSS_HANDLES = [ // "wrapperComponentPix", // "imagePix", // "wrapperTexts", // "wrapperTexts__value", // "wrapperTexts__descontoPorcentagem", // ] // const handles = useCssHandles(CSS_HANDLES) if (typeof document !== "undefined") { const input = document.querySelector(".vtex-address-form-4-x-input"); input?.setAttribute("placeholder", "Digite seu CEP"); } return (
PixIcon

R$ {pixValueDescontoVirgula}

10% de desconto

) } export default Pix