"use strict";

exports.__esModule = true;
exports.useCreateImport = useCreateImport;
var _react = require("react");
var _providers = require("../providers");
var _state = require("../state");
function useCreateImport(params) {
  const {
    config,
    detectColumnType,
    importModalState
  } = params;
  const {
    showToast,
    translate,
    errorHandler,
    window,
    httpClient
  } = (0, _providers.useWixPatternsContainer)();
  const collection = (0, _providers.useCollectionContext)();
  return (0, _react.useCallback)(() => {
    return new _state.ImportState({
      config,
      httpClient,
      detectColumnType,
      collection,
      importModalState,
      showToast,
      translate,
      errorHandler,
      downloadCsv: (content, fileName) => {
        window.download(`data:text/csv;charset=utf-8,${encodeURIComponent(content)}`, fileName);
      }
    });
  }, []);
}
//# sourceMappingURL=useImport.js.map