import type { FC } from 'react' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' import { RiArrowDownSLine } from '@remixicon/react' import Dropdown from '@/app/components/base/dropdown' import { SlidersH } from '@/app/components/base/icons/src/vender/line/mediaAndDevices' import { Brush01 } from '@/app/components/base/icons/src/vender/solid/editor' import { Scales02 } from '@/app/components/base/icons/src/vender/solid/FinanceAndECommerce' import { Target04 } from '@/app/components/base/icons/src/vender/solid/general' import { TONE_LIST } from '@/config' type PresetsParameterProps = { onSelect: (toneId: number) => void } const PresetsParameter: FC = ({ onSelect, }) => { const { t } = useTranslation() const renderTrigger = useCallback((open: boolean) => { return (
{t('common.modelProvider.loadPresets')}
) }, []) const getToneIcon = (toneId: number) => { const className = 'mr-2 w-[14px] h-[14px]' const res = ({ 1: , 2: , 3: , })[toneId] return res } const options = TONE_LIST.slice(0, 3).map((tone) => { return { value: tone.id, text: (
{getToneIcon(tone.id)} {t(`common.model.tone.${tone.name}`) as string}
), } }) return ( onSelect(item.value as number)} popupClassName='z-[1003]' /> ) } export default PresetsParameter