import { useTranslation } from 'react-i18next'; import { Button, Form, Input, InputNumber, Select, Switch, type FormInstance } from 'antd'; import { DeleteOutlined, PlusOutlined } from '@ant-design/icons'; import { OutboundDomainStrategies } from '@/schemas/primitives'; import type { OutboundFormValues } from '@/schemas/forms/outbound-form'; export default function FreedomFields({ form }: { form: FormInstance }) { const { t } = useTranslation(); return ( <> )} ); }} {(fields, { add, remove }) => ( <> 0} onChange={(checked) => { if (checked) { add({ type: 'rand', packet: '10-20', delay: '10-16', applyTo: 'ip', }); } else { // remove() with no arg is not supported; // walk fields in reverse and drop each. for (let i = fields.length - 1; i >= 0; i--) { remove(fields[i].name); } } }} /> {fields.length > 0 && (