import React from 'react';
import { PDA_IMAGE_PATH } from '../../global';
import './index.scss';

const classPrefix = 'image-uploader';

interface UploadButtonProps {
  box?: number;
  onUpload?: () => void;
}

const UploadButton: React.FC<UploadButtonProps> = ({ box = 104, onUpload }) => {
  return (
    <div
      className={`${classPrefix}-upload-button`}
      onClick={onUpload}
      style={{ width: box, height: box }}
    >
      <div className={`${classPrefix}-upload-button-icon`}>
        <svg
          viewBox='64 64 896 896'
          focusable='false'
          data-icon='plus'
          width='1em'
          height='1em'
          fill='currentColor'
          aria-hidden='true'
        >
          <path d='M480 480V128a32 32 0 0164 0v352h352a32 32 0 110 64H544v352a32 32 0 11-64 0V544H128a32 32 0 010-64h352z'></path>
        </svg>
      </div>
      <div className={`${classPrefix}-upload-button-text`}>上传图片</div>
    </div>
  );
};

export default UploadButton;
