Wizard: "No results" option should be disabled

This moves the "No results" option outside of options and renders it as a disabled option when `selectOptions.lenght === 0`.
This commit is contained in:
regexowl 2025-04-02 13:24:10 +02:00 committed by Klara Simickova
parent f3776bbf1a
commit e9b73c55a4

View file

@ -86,9 +86,6 @@ const ActivationKeysList = () => {
.filter((keyName: string) =>
String(keyName).toLowerCase().includes(filterValue.toLowerCase())
);
if (filteredKeys && !filteredKeys.length) {
filteredKeys = [`No results found for "${filterValue}"`];
}
if (!isOpen) {
setIsOpen(true);
}
@ -204,6 +201,14 @@ const ActivationKeysList = () => {
);
}
if (isSuccessActivationKeys && selectOptions.length === 0) {
selectOptionsElement.push(
<SelectOption key="no_results" value="no_results" isDisabled>
No results found
</SelectOption>
);
}
return selectOptionsElement;
};