auto enum generation
This commit is contained in:
parent
cbe6381233
commit
2add2bc9cd
|
|
@ -29,7 +29,16 @@ export function AutocompleteSelect({ title, titleProps = null, data, nullable =
|
|||
return item.label.toLowerCase().includes(query.toLowerCase());
|
||||
})
|
||||
);
|
||||
} else {
|
||||
} else if(typeof data === "object")
|
||||
{
|
||||
setInternalData(Object.values(data).map((value) => {
|
||||
return {
|
||||
value: value,
|
||||
label: value
|
||||
};
|
||||
}));
|
||||
}
|
||||
else {
|
||||
console.error("data is not an array or function :c");
|
||||
setInternalData([]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user