import * as React from 'react'; import cn from 'classnames'; import { IFormComponentProps, IFormFieldChildProps } from '../shared'; import { FormField } from '../Field'; import { ImageUpload, IImageUploadFileItem, IImageUploadProps, } from '../../upload'; import { warningDefaultValueProp } from '../utils'; import omit from '../../utils/omit'; export type IFormImageUploadFieldProps = IFormComponentProps< T[], Omit >; function renderImageUpload( childProps: IFormFieldChildProps, props: IFormImageUploadFieldProps ) { const { value, onChange } = childProps; return ( ); } export function FormImageUploadField( props: IFormImageUploadFieldProps ) { const { className, ...rest } = props; React.useEffect(() => { // warning for use 'props.defaultFileList' in Form Upload Field warningDefaultValueProp( !('defaultFileList' in (props.props ?? {})), 'defaultFileList', 'FormImageUploadField' ); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return ( {childProps => renderImageUpload(childProps, props)} ); }