import { RAGFlowFormItem } from '@/components/ragflow-form'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Trash2 } from 'lucide-react'; import { useFieldArray, useFormContext } from 'react-hook-form'; import { DynamicFormHeader, FormListHeaderProps } from './dynamic-fom-header'; type DynamicStringFormProps = { name: string } & FormListHeaderProps; export function DynamicStringForm({ name, label }: DynamicStringFormProps) { const form = useFormContext(); const { fields, append, remove } = useFieldArray({ name: name, control: form.control, }); return (
append({ value: '' })} >
{fields.map((field, index) => (
))}
); }