index.tsx 745 Bytes

import { Field } from '@formily/react';
import { FormItem } from '@formily/antd-v5';
import cx from 'classnames';
import './index.less';
import { FieldProps } from '../../typings';
import UploadFiles from '@/hr/upload_file';

const InputUpload: React.FC<FieldProps> = (props) => {
  const { name, title, validator = [], decoratorProps, componentProps } = props;

  return (
    <div className={cx('global_textarea')}>
      <Field
        {...props}
        name={name}
        title={title}
        decorator={[FormItem, { ...decoratorProps }]}
        component={[
          UploadFiles,
          {
            ...componentProps,
          },
        ]}
        validator={validator}
      />
    </div>
  );
};

export default InputUpload;