import React from "react"; import styles from "./_PixCustomInstallments.module.css"; import { useProduct } from "vtex.product-context"; import { calculationPercent, sanatizeColor } from "./_ComponentsFunctions"; interface IPixCustomInstallmentsProps { label: string; percent: number; color: string; } export function PixCustomInstallments({ label = "de desconto", percent = 10, color = "c-on-base", }: IPixCustomInstallmentsProps) { const data = useProduct(); return (
{`R$ ${calculationPercent( percent, data?.product?.priceRange.sellingPrice.highPrice )}`}
{`${percent}% ${label}`}