import React from 'react'; import { Listbox, Transition } from '@headlessui/react'; import type { Option } from '~/common'; import CheckMark from '../svg/CheckMark'; import { useLocalize } from '~/hooks'; import { cn } from '~/utils/'; type SelectDropDownProps = { id?: string; title?: string; value: string | null | Option; disabled?: boolean; setValue: (value: string) => void; availableValues: string[] | Option[]; emptyTitle?: boolean; showAbove?: boolean; showLabel?: boolean; iconSide?: 'left' | 'right'; renderOption?: () => React.ReactNode; containerClassName?: string; currentValueClass?: string; optionsListClass?: string; optionsClass?: string; subContainerClassName?: string; className?: string; }; function SelectDropDown({ title: _title, value, disabled, setValue, availableValues, showAbove = false, showLabel = true, emptyTitle = false, iconSide = 'right', containerClassName, optionsListClass, optionsClass, currentValueClass, subContainerClassName, className, renderOption, }: SelectDropDownProps) { const localize = useLocalize(); const transitionProps = { className: 'top-full mt-3' }; if (showAbove) { transitionProps.className = 'bottom-full mb-3'; } let title = _title; if (emptyTitle) { title = ''; } else if (!title) { title = localize('com_ui_model'); } return (