import type { FC } from 'react' import { useState } from 'react' import { useTranslation } from 'react-i18next' import { RiArrowDownSLine } from '@remixicon/react' import cn from '@/utils/classnames' import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' import { Check } from '@/app/components/base/icons/src/vender/line/general' type MethodSelectorProps = { value?: string onChange: (v: string) => void } const MethodSelector: FC = ({ value, onChange, }) => { const { t } = useTranslation() const [open, setOpen] = useState(false) return (
setOpen(v => !v)} className='block' >
{value === 'llm' ? t('tools.createTool.toolInput.methodParameter') : t('tools.createTool.toolInput.methodSetting')}
onChange('llm')}>
{value === 'llm' && }
{t('tools.createTool.toolInput.methodParameter')}
{t('tools.createTool.toolInput.methodParameterTip')}
onChange('form')}>
{value === 'form' && }
{t('tools.createTool.toolInput.methodSetting')}
{t('tools.createTool.toolInput.methodSettingTip')}
) } export default MethodSelector