/* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ import dayjs from "dayjs"; import { useLocale } from "@/hooks/useLocale"; import { PriceManager } from "@/libs/price-manager/price-manager"; export interface PayPreferencesProps { data: { firstProvisionDate?: any; firstProvisionDay?: any; isCancelBook: boolean; isCancelPayment: boolean; lastProvisionDate?: any; lastProvisionDay?: any; minAmountRate: number; minPaymentAmount: string; balanceAmount: number; totalAmount: string; paymentDay?: any; paymentDayType?: any; paymentDueDate: string; provisionDayType?: any; code?: any; }; activeMasterpassCidssRules: number; setActiveMasterpassCidssRules: (values: number) => void; } const PayPreferences = (props: PayPreferencesProps) => { const buyNowpayLater = +props.data.totalAmount.slice(3) !== +props.data.minPaymentAmount.slice(3); const { t } = useLocale(); return (
{t("Payment Preferences")} {t( "Your Masterpass payment will be taken with the assurance of Jolly Tur.", )}
{buyNowpayLater && (
props.setActiveMasterpassCidssRules(0)} className="flex cursor-pointer flex-col gap-3" >
{t("Buy now, pay later")}
{t("Amount payable now")} (%{props.data.minAmountRate}) {PriceManager({ currency: props.data.minPaymentAmount.slice(0, 3), value: +props.data.minPaymentAmount.slice(3), })}
{t("Amount payable on {{date}}", { date: dayjs(props.data.paymentDueDate).format("DD.MM.YYYY"), })} (% {100 - props.data.minAmountRate}) {PriceManager({ currency: props.data.totalAmount.slice(0, 3), value: +props.data.balanceAmount.toString(), })}
)}
props.setActiveMasterpassCidssRules(1)} className="flex cursor-pointer flex-col gap-3" >
{t("Pay now")}
); }; export { PayPreferences };