import { CloseOutlined } from '@ant-design/icons'; import { Button, Card, Form, Input, Select, Typography } from 'antd'; import { useBuildCategorizeToOptions, useHandleToSelectChange } from './hooks'; interface IProps { nodeId?: string; } const DynamicCategorize = ({ nodeId }: IProps) => { const form = Form.useFormInstance(); const options = useBuildCategorizeToOptions(); const { handleSelectChange } = useHandleToSelectChange( options.map((x) => x.value), nodeId, ); return ( <> {(fields, { add, remove }) => { const handleAdd = () => { const idx = fields.length; add({ name: `Categorize ${idx + 1}` }); }; return (
{fields.map((field) => ( { remove(field.name); }} /> } >