import React from "react"; import { useProduct } from "vtex.product-context"; // import { useCssHandles } from "vtex.css-handles"; import styles from "./styles.css"; const pixCustom = () => { const productContextValue = useProduct(); // {productContextValue?.product?.priceRange.sellingPrice.highPrice} const valorString = productContextValue?.product?.priceRange.sellingPrice.lowPrice; const valorNumber = Number(valorString); const desconto = 0.9;
var pix = (valorNumber * desconto).toFixed(2).replace(".", ","); console.log(pix); // const CSS_HANDLES = [ // "divConteiner", // "divImg", // "img", // "divText", // "h1Valor", // "h2Desconto", // ]; // const handles = useCssHandles(CSS_HANDLES); return (
Imagem Pix

R$ {pix}

10% de desconto

); }; export default pixCustom;