import React from 'react'; import { Root, Trigger, Content, Portal } from '@radix-ui/react-popover'; import MenuItem from '~/components/Chat/Menus/UI/MenuItem'; import type { Option } from '~/common'; 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; }; function SelectDropDownPop({ title: _title, value, availableValues, setValue, showAbove = false, showLabel = true, emptyTitle = false, }: 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 (
{availableValues.map((option) => { return ( setValue(option)} /> ); })}
); } export default SelectDropDownPop;