Feat: Construct RetrievalForm with original fields #3221 (#8012)

### What problem does this PR solve?

Feat: Construct RetrievalForm with original fields #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-06-03 15:40:04 +08:00
committed by GitHub
parent e64da8b2aa
commit 4cd0df0567
7 changed files with 116 additions and 99 deletions

View File

@ -0,0 +1,31 @@
import { SelectWithSearch } from '@/components/originui/select-with-search';
import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/form';
import { useFormContext } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
export function QueryVariable() {
const { t } = useTranslation();
const form = useFormContext();
return (
<FormField
control={form.control}
name="query"
render={({ field }) => (
<FormItem>
<FormLabel tooltip={t('chat.modelTip')}>{t('flow.query')}</FormLabel>
<FormControl>
<SelectWithSearch {...field}></SelectWithSearch>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
);
}