import React from 'react'; import { Wrench } from 'lucide-react'; import { Root, Trigger, Content, Portal } from '@radix-ui/react-popover'; import type { TPlugin } from 'librechat-data-provider'; import MenuItem from '~/components/Chat/Menus/UI/MenuItem'; import { cn } from '~/utils/'; type SelectDropDownProps = { title?: string; value: Array<{ icon?: string; name?: string; isButton?: boolean }>; disabled?: boolean; setSelected: (option: string) => void; availableValues: TPlugin[]; showAbove?: boolean; showLabel?: boolean; containerClassName?: string; isSelected: (value: string) => boolean; className?: string; optionValueKey?: string; }; function MultiSelectPop({ title: _title = 'Plugins', value, setSelected, availableValues, showAbove = false, showLabel = true, containerClassName, isSelected, optionValueKey = 'value', }: SelectDropDownProps) { // const localize = useLocalize(); const title = _title; const excludeIds = ['select-plugin', 'plugins-label', 'selected-plugins']; return (
{availableValues.map((option) => { if (!option) { return null; } const selected = isSelected(option[optionValueKey]); return ( setSelected(option.pluginKey)} icon={ option.icon ? ( {`${option.name} ) : ( ) } /> ); })}
); } export default MultiSelectPop;