/**
 * Upload 字段渲染策略
 */

import React from 'react';
import { Upload, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { BaseFieldStrategy } from './BaseFieldStrategy';
import type { FieldRenderContext } from '../IFieldRenderStrategy';

export class UploadStrategy extends BaseFieldStrategy {
  supportsReadonly = false;

  render(context: FieldRenderContext): React.ReactNode {
    const { field } = context;
    const disabledProps = this.getDisabledProps(context);
    
    return (
      <Upload
        {...disabledProps}
        maxCount={field.maxCount}
      >
        <Button icon={<UploadOutlined />}>上传文件</Button>
      </Upload>
    );
  }
}

