2023-01-24 23:41:02 +00:00
|
|
|
import React from "react";
|
|
|
|
import { useProduct } from "vtex.product-context";
|
2023-01-25 11:30:00 +00:00
|
|
|
import styles from "./InstallmentProduct.module.css";
|
2023-01-24 23:41:02 +00:00
|
|
|
|
|
|
|
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 (
|
2023-01-25 11:30:00 +00:00
|
|
|
<p className={styles.PriceContent}>
|
|
|
|
<strong>{productWithInstallments.numberOfInstallments}x </strong>
|
2023-01-24 23:41:02 +00:00
|
|
|
de
|
|
|
|
<strong>
|
|
|
|
R$
|
|
|
|
{productWithInstallments.value?.toFixed(2).toString().replace(".", ",")}
|
2023-01-25 11:30:00 +00:00
|
|
|
</strong>{" "}
|
|
|
|
sem juros
|
2023-01-24 23:41:02 +00:00
|
|
|
</p>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default InstallmentProduct;
|