/* eslint-disable @typescript-eslint/no-explicit-any */ import { Listbox } from '@headlessui/react' import { ChevronDownIcon } from '@heroicons/react/20/solid' import { ReactNode } from 'react' import { TradeForm } from 'types' type Values = TradeForm['tradeType'] | ReactNode interface SelectProps { value: T | string onChange: (x: T) => void children: ReactNode className?: string buttonClassName?: string dropdownPanelClassName?: string icon?: ReactNode placeholder?: string disabled?: boolean } const Select = ({ value, onChange, children, className, buttonClassName, dropdownPanelClassName, icon, placeholder = 'Select', disabled = false, }: SelectProps) => { return (
{({ open }) => ( <>
{icon ? icon : null} {value ? ( value ) : ( {placeholder} )}
{children} )}
) } interface OptionProps { value: string children: string | ReactNode className?: string } const Option = ({ value, children, className }: OptionProps) => { return ( {({ selected }) => (
{children}
)}
) } Select.Option = Option export default Select