fix: handle undefined values for number of bathrooms and parking spots in CardInfos

This commit is contained in:
Marco Pedone 2026-01-07 14:31:34 +01:00
parent e499923fcb
commit f9cacce912

View file

@ -487,7 +487,7 @@ const CardInfos = ({ data }: { data: Annunci }) => {
</div>
<div className="flex justify-center gap-2 rounded-md bg-primary-foreground p-2 text-primary">
<Bath />
<span>{data.numero_bagni} bagni</span>
<span>{data.numero_bagni || 0} bagni</span>
</div>
<div className="flex justify-center gap-2 rounded-md bg-primary-foreground p-2 text-primary">
<Armchair />
@ -495,7 +495,7 @@ const CardInfos = ({ data }: { data: Annunci }) => {
</div>
<div className="flex justify-center gap-2 rounded-md bg-primary-foreground p-2 text-primary">
<Car />
<span>{data.numero_postiauto} posti auto</span>
<span>{data.numero_postiauto || 0} posti auto</span>
</div>
</div>
</div>