Files
ragflow/web/src/components/large-model-form-field.tsx
balibabu 84f5ae20be Feat: Add the SelectWithSearch component #3221 (#7892)
### What problem does this PR solve?

Feat: Add the SelectWithSearch component #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-05-28 09:22:09 +08:00

32 lines
730 B
TypeScript

import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/form';
import { useFormContext } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import { NextLLMSelect } from './llm-select/next';
export function LargeModelFormField() {
const form = useFormContext();
const { t } = useTranslation();
return (
<FormField
control={form.control}
name="llm_id"
render={({ field }) => (
<FormItem>
<FormLabel tooltip={t('chat.modelTip')}>{t('chat.model')}</FormLabel>
<FormControl>
<NextLLMSelect {...field} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
);
}