import React from 'react';
import { Space } from 'antd';
import UploadImage from "@/components/Upload/UploadImage";

export default (props) => {
  const { value = [], onChange, limit = 1, ratio, tips } = props;

  const handleChange = (inx = 0) => e => {
    value[inx] = e;
    onChange(value.slice());
  }

  return (
    <div className="flex">
      <div className="flex-0">
        <UploadImage
          onChange={handleChange(0)}
          value={value[0]}
          ratio={ratio}
          tips={tips}
        />
      </div>
      {/* {
        limit > 1 ? (
          <div className="flex-0" style={{ marginLeft: '24px' }}>
            <UploadImage
              onChange={handleChange(1)}
              value={value[1]}
              ratio={ratio}
              tips={tips}
            />
          </div>
        ) : null
      }
      {
        limit > 2 ? (
          <div className="flex-0" style={{ marginLeft: '24px' }}>
            <UploadImage
              onChange={handleChange(2)}
              value={value[2]}
              ratio={ratio}
              tips={tips}
            />
          </div>
        ) : null
      } */}
    </div>
  )
}
