import { Listbox, Transition } from '@headlessui/react'; import { ChevronUpDownIcon } from '@heroicons/react/20/solid'; import { Fragment } from 'react'; type SingleSelectType = { items: { [key: string]: string }; selected: string; onChange?: (changedStatus: string) => void; }; const SingleSelect = ({ items, selected, onChange }: SingleSelectType) => { return (
{items[selected]} {Object.keys(items).map((action, index) => ( `wmx-text-gray-900 wmx-m-0 wmx-cursor-default wmx-outline-none wmx-select-none wmx-text-sm wmx-p-1 wmx-px-2 ${ active ? 'wmx-bg-gray-200' : '' }` } value={action} > {({ active }) => ( {items[action]} )} ))}
); }; export default SingleSelect;