diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 64a14c3..e499ccc 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -31,6 +31,11 @@ function CardTypeSelect({ }, [open]); const current = options.find(o => o.value === value); + // Fallback: se il value non matcha nessuna opzione (es. tipo disattivato dalla flag), mostra il valore raw prettificato + const displayLabel = current?.label + ?? (typeof value === 'string' && value.length > 0 + ? value.replace(/_/g, ' ').toLowerCase().replace(/\b\w/g, c => c.toUpperCase()) + : ''); const inputBase = "w-full border border-gray-300 p-2.5 rounded-lg outline-none focus:ring-2 focus:ring-blue-500 bg-white text-gray-900"; return ( @@ -40,7 +45,7 @@ function CardTypeSelect({ onClick={() => setOpen(o => !o)} className={`${inputBase} text-left flex items-center justify-between cursor-pointer`} > - {current?.label || ''} + {displayLabel || 'Seleziona…'} {open && (