feat: update defaultValue in PricingComponent to use prop value instead of hardcoded zero
This commit is contained in:
parent
eb36e07076
commit
9d66997001
1 changed files with 3 additions and 1 deletions
|
|
@ -103,6 +103,7 @@ export const PricingComponent = ({
|
||||||
opzioni,
|
opzioni,
|
||||||
cta,
|
cta,
|
||||||
statico = false,
|
statico = false,
|
||||||
|
defaultValue = 0,
|
||||||
className,
|
className,
|
||||||
title,
|
title,
|
||||||
tipo,
|
tipo,
|
||||||
|
|
@ -113,12 +114,13 @@ export const PricingComponent = ({
|
||||||
title: string;
|
title: string;
|
||||||
cta: string;
|
cta: string;
|
||||||
statico?: boolean;
|
statico?: boolean;
|
||||||
|
defaultValue?: number;
|
||||||
className?: string;
|
className?: string;
|
||||||
tipo: TipologiaPosizioneEnum;
|
tipo: TipologiaPosizioneEnum;
|
||||||
optionsBtnClassName?: string;
|
optionsBtnClassName?: string;
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [Value, setValue] = useState<number>(0);
|
const [Value, setValue] = useState<number>(defaultValue);
|
||||||
const p = pricingData[Value];
|
const p = pricingData[Value];
|
||||||
const downPayment = p?.downPayment || 0;
|
const downPayment = p?.downPayment || 0;
|
||||||
const secondPayment = p?.secondPayment || 0;
|
const secondPayment = p?.secondPayment || 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue