function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from "react";
import { Icon } from "@blueprintjs/core";
import Dropzone from "react-dropzone";
import ToolbarItem from "./ToolbarItem";
import { compose, withHandlers } from "recompose";
import { importSequenceFromFile, connectToEditor } from "../withEditorProps";
export default compose(connectToEditor(), withHandlers({
  importSequenceFromFile: importSequenceFromFile
}))(function (_ref) {
  var toolbarItemProps = _ref.toolbarItemProps,
    importSequenceFromFile = _ref.importSequenceFromFile;
  return /*#__PURE__*/React.createElement(ToolbarItem, _extends({
    Icon: /*#__PURE__*/React.createElement(Icon, {
      "data-test": "veImportTool",
      icon: "export"
    }),
    IconWrapper: Dropzone,
    IconWrapperProps: {
      multiple: false,
      style: {},
      onDrop: function onDrop(files) {
        return importSequenceFromFile(files[0]);
      }
    },
    tooltip: "单击或拖动导入和查看文件 (.fasta .gb .dna)"
  }, toolbarItemProps));
});