import React, { useState, useRef } from 'react'; import { Listbox, Transition } from '@headlessui/react'; import { Wrench, ArrowRight } from 'lucide-react'; import { CheckMark } from '~/components/svg'; import useOnClickOutside from '~/hooks/useOnClickOutside'; import { MultiSelectDropDownProps } from 'librechat-data-provider'; import { cn } from '~/utils/'; function MultiSelectDropDown({ title = 'Plugins', value, disabled, setSelected, availableValues, showAbove = false, showLabel = true, containerClassName, isSelected, className, optionValueKey = 'value', }: MultiSelectDropDownProps) { const [isOpen, setIsOpen] = useState(false); const menuRef = useRef(null); const excludeIds = ['select-plugin', 'plugins-label', 'selected-plugins']; useOnClickOutside(menuRef, () => setIsOpen(false), excludeIds); const handleSelect: (value: string) => void = (option) => { setSelected(option); setIsOpen(true); }; const transitionProps = { className: 'top-full mt-3' }; if (showAbove) { transitionProps.className = 'bottom-full mb-3'; } const openProps = { open: isOpen }; return (