import { memo } from 'react' import { Form, Input } from 'antd' import { NamePath, Rule } from 'rc-field-form/lib/interface' type EditableCellProps = React.DetailedHTMLProps, HTMLTableDataCellElement> & { editing?: boolean dataIndex?: NamePath input?: React.Component isRequired?: boolean title: string formItemClass?: string formItemRules?: Rule[] children: React.ReactNode initialValue: any } export const EditableCell = memo(({ editing, dataIndex, input, isRequired, formItemClass, formItemRules, children, initialValue, ...other }) => ( {!editing ? children : ( {input ?? } )} ))