import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import Button, { ButtonProps } from 'antd/lib/button'; import React from 'react'; import { ConnectedField, connectField, FieldProps, filterDOMProps, joinName, useField, } from 'uniforms'; export type ListDelFieldProps = FieldProps; function ListDel({ disabled, icon = , name, readOnly, shape = 'circle', size = 'small', type = 'default', ...props }: ListDelFieldProps) { const nameParts = joinName(null, name); const nameIndex = +nameParts[nameParts.length - 1]; const parentName = joinName(nameParts.slice(0, -1)); const parent = useField<{ minCount?: number }, unknown[]>( parentName, {}, { absoluteName: true }, )[0]; disabled ||= readOnly || parent.minCount! >= parent.value!.length; return (