chore: sync frontend/src/_ui/Select/SelectComponent.jsx with main branch

This commit is contained in:
johnsoncherian 2025-05-15 00:05:45 +05:30
parent 0868447e92
commit a442207a6e

View file

@ -31,11 +31,11 @@ export const SelectComponent = ({ options = [], value, onChange, closeMenuOnSele
Array.isArray(options) && options.length === 0
? options
: options?.map((option) => {
if (!option.hasOwnProperty('label')) {
return _.mapKeys(option, (value, key) => (key === 'value' ? key : 'label'));
}
return option;
});
if (!option.hasOwnProperty('label')) {
return _.mapKeys(option, (value, key) => (key === 'value' ? key : 'label'));
}
return option;
});
const currentValue = value ? selectOptions.find((option) => option.value === value) || value : defaultValue;