import React from 'react'; import { Listbox } from '@headlessui/react'; import { CheckIcon, SelectorIcon } from '@heroicons/react/solid'; export interface SelectProps { label: string; options: { name: string; value: string; icon: JSX.Element; }[]; id: string; active: { name: string; value: string; icon: JSX.Element; }; onChange: (value: string) => void; } export const Select = ({ label, options, id, active, onChange, }: SelectProps): JSX.Element => { return (
{active.icon}
{active.name}
{options.map((option) => ( `cursor-default select-none relative py-2 pl-10 pr-4 first:rounded-t-md last:rounded-b-md dark:text-white ${ active ? 'bg-gray-200 dark:bg-primaryDark' : 'text-gray-900' }` } value={option.value} > {({ selected, active }): JSX.Element => ( <> {option.name} {selected ? ( ) : null} )} ))}
); };