import { CloseOutlined } from '@ant-design/icons'; import { Button, Card, Form, Input, Select, Typography } from 'antd'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { Operator } from '../constant'; import { useBuildFormSelectOptions } from '../form-hooks'; import { IOperatorForm } from '../interface'; const subLabelCol = { span: 7, }; const subWrapperCol = { span: 17, }; const SwitchForm: React.FC = ({ form, onValuesChange, nodeId, }: IOperatorForm) => { const { t } = useTranslation(); const buildCategorizeToOptions = useBuildFormSelectOptions( Operator.Categorize, nodeId, ); return (
{(fields, { add, remove }) => (
{fields.map((field) => ( { remove(field.name); }} /> } > ))}
)}
))} )} {() => (
{JSON.stringify(form?.getFieldsValue(), null, 2)}
)}
); }; export default SwitchForm;