mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10:15 +01:00
🔧 fix(menu): Menu Item Filter Improvements (#2153)
* small-fix: Ensure that fake seperators in model lists do not show in search * Ensure Plugin search uses correct placeholder and key filtering in search
This commit is contained in:
parent
30f6d90cfe
commit
f521040784
6 changed files with 33 additions and 9 deletions
|
|
@ -18,6 +18,7 @@ type SelectDropDownProps = {
|
|||
isSelected: (value: string) => boolean;
|
||||
className?: string;
|
||||
optionValueKey?: string;
|
||||
searchPlaceholder?: string;
|
||||
};
|
||||
|
||||
function MultiSelectPop({
|
||||
|
|
@ -30,6 +31,7 @@ function MultiSelectPop({
|
|||
containerClassName,
|
||||
isSelected,
|
||||
optionValueKey = 'value',
|
||||
searchPlaceholder,
|
||||
}: SelectDropDownProps) {
|
||||
// const localize = useLocalize();
|
||||
|
||||
|
|
@ -37,7 +39,11 @@ function MultiSelectPop({
|
|||
const excludeIds = ['select-plugin', 'plugins-label', 'selected-plugins'];
|
||||
|
||||
// Detemine if we should to convert this component into a searchable select
|
||||
const [filteredValues, searchRender] = useMultiSearch<TPlugin[]>(availableValues);
|
||||
const [filteredValues, searchRender] = useMultiSearch<TPlugin[]>(
|
||||
availableValues,
|
||||
searchPlaceholder,
|
||||
(option) => (option.name || '').toUpperCase(),
|
||||
);
|
||||
const hasSearchRender = Boolean(searchRender);
|
||||
const options = hasSearchRender ? filteredValues : availableValues;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue