import React from "react"; import { useProduct } from "vtex.product-context"; import styles from "./InstallmentProduct.module.css"; const InstallmentProduct = () => { const product = useProduct(); const productWithInstallments = { numberOfInstallments: product?.selectedItem?.sellers[0].commertialOffer.Installments[10] .NumberOfInstallments, value: product?.selectedItem?.sellers[0].commertialOffer.Installments[10].Value, }; return (
{productWithInstallments.numberOfInstallments}x de R$ {productWithInstallments.value?.toFixed(2).toString().replace(".", ",")} {" "} sem juros
); }; export default InstallmentProduct;