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 (
Promoção de pagamento com o PIX

{`R$ ${calculationPercent( percent, data?.product?.priceRange.sellingPrice.highPrice )}`}

{`${percent}% ${label}`}

); } PixCustomInstallments.schema = { title: "Promoção de pagamento com o PIX", type: "object", properties: { label: { type: "string", }, percent: { type: "number", }, color: { type: "string", }, }, };