import { Fragment } from 'react' import { ChevronDownIcon } from '@heroicons/react/20/solid' import { useTranslation } from 'next-i18next' import { Popover, Transition } from '@headlessui/react' import Checkbox from './Checkbox' const MultiSelectDropdown = ({ options, selected, toggleOption, }: { options: string[] selected: string[] toggleOption: (x: string) => void }) => { const { t } = useTranslation('common') return ( {({ open }) => (
{selected.length ? ( {selected.toString().replace(/,/g, ', ')} ) : ( {t('activity:select-tokens')} )}
{options.map((option: string) => { const isSelected = selected.includes(option) return ( toggleOption(option)} > {option} ) })}
)}
) } export default MultiSelectDropdown