2023-01-25 13:43:53 +00:00
|
|
|
import React from "react";
|
|
|
|
import { useProduct } from "vtex.product-context";
|
|
|
|
import styles from "./Installment.module.css";
|
|
|
|
|
|
|
|
const Installment = () => {
|
|
|
|
const skuProduct = useProduct();
|
|
|
|
console.log(skuProduct);
|
|
|
|
|
2023-01-25 17:39:37 +00:00
|
|
|
const productInstallment: any = {
|
2023-01-25 13:43:53 +00:00
|
|
|
numberOfInstallment:
|
|
|
|
skuProduct?.selectedItem?.sellers[0].commertialOffer.Installments[3]
|
|
|
|
.NumberOfInstallments,
|
|
|
|
value:
|
|
|
|
skuProduct?.selectedItem?.sellers[0].commertialOffer.Installments[3]
|
|
|
|
.Value,
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<p className={styles["installment-product"]}>
|
|
|
|
<span className={styles["installment-product__strong"]}>
|
|
|
|
{productInstallment.numberOfInstallment}x{" "}
|
|
|
|
</span>
|
|
|
|
de
|
|
|
|
<span className={styles["installment-product__strong"]}>
|
|
|
|
{""} R${" "}
|
|
|
|
{productInstallment.value?.toFixed(2).toString().replace(".", ",")}{" "}
|
|
|
|
</span>
|
|
|
|
sem juros
|
|
|
|
</p>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Installment;
|