import { useFieldArray, type Control, type UseFormRegister } from 'react-hook-form'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { Plus, Trash2 } from 'lucide-react'; interface AttributeSchemaBuilderProps { control: Control; register: UseFormRegister; } export function AttributeSchemaBuilder({ control, register }: AttributeSchemaBuilderProps) { const { fields, append, remove } = useFieldArray({ control, name: 'attributes', }); return (

{fields.length === 0 && (

No attributes defined. Payload will be empty.

)}
{fields.map((field, index) => (
))}
); }