fix: handle both array and string cases in RSVPForm renderValue function

This commit is contained in:
Your Name
2025-04-29 19:18:11 -04:00
parent d32ef9b50f
commit d7030a2c33

View File

@@ -207,11 +207,15 @@ const RSVPForm: React.FC = () => {
input={<OutlinedInput label="What items are you bringing?" />}
renderValue={(selected) => (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
{selected.map((value) => (
{Array.isArray(selected) ? selected.map((value) => (
<Typography key={value} variant="body2">
{value}
</Typography>
))}
)) : (
<Typography variant="body2">
{selected}
</Typography>
)}
</Box>
)}
>