feat: update defaultValue in PricingComponent to use prop value instead of hardcoded zero

This commit is contained in:
Marco Pedone 2026-03-16 17:57:48 +01:00
parent eb36e07076
commit 9d66997001

View file

@ -103,6 +103,7 @@ export const PricingComponent = ({
opzioni,
cta,
statico = false,
defaultValue = 0,
className,
title,
tipo,
@ -113,12 +114,13 @@ export const PricingComponent = ({
title: string;
cta: string;
statico?: boolean;
defaultValue?: number;
className?: string;
tipo: TipologiaPosizioneEnum;
optionsBtnClassName?: string;
}) => {
const { t } = useTranslation();
const [Value, setValue] = useState<number>(0);
const [Value, setValue] = useState<number>(defaultValue);
const p = pricingData[Value];
const downPayment = p?.downPayment || 0;
const secondPayment = p?.secondPayment || 0;