import { Plus, Trash } from 'lucide-react' import { useFieldArray, UseFormReturn } from 'react-hook-form' import { Button, FormControl_Shadcn_, FormField_Shadcn_, Input_Shadcn_, SidePanel } from 'ui' import { WebhookFormValues } from './EditHookPanel.constants' import { ButtonTooltip } from '@/components/ui/ButtonTooltip' import { FormSection, FormSectionContent, FormSectionLabel, } from '@/components/ui/Forms/FormSection' import { uuidv4 } from '@/lib/helpers' interface HTTPParametersProps { form: UseFormReturn } export const HTTPParameters = ({ form }: HTTPParametersProps) => { const { fields: paramFields, append: appendParam, remove: removeParam, } = useFieldArray({ control: form.control, name: 'httpParameters', }) return ( HTTP Parameters} >
{paramFields.map((field, index) => (
( )} /> ( )} /> } onClick={() => removeParam(index)} tooltip={{ content: { side: 'bottom', text: 'Remove parameter' } }} />
))}
) }