"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const reactBinding = require("@contember/react-binding");
const getGenericFileMetadataExtractor = ({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }) => ({
  staticRender: () => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
    !!fileNameField && /* @__PURE__ */ jsxRuntime.jsx(reactBinding.SugaredField, { field: fileNameField }),
    !!fileSizeField && /* @__PURE__ */ jsxRuntime.jsx(reactBinding.SugaredField, { field: fileSizeField }),
    !!fileTypeField && /* @__PURE__ */ jsxRuntime.jsx(reactBinding.SugaredField, { field: fileTypeField }),
    !!lastModifiedField && /* @__PURE__ */ jsxRuntime.jsx(reactBinding.SugaredField, { field: lastModifiedField })
  ] }),
  populateFields: ({ entity, file }) => {
    entity.batchUpdates((getAccessor) => {
      fileNameField && getAccessor().getField(fileNameField).updateValue(file.name);
      fileSizeField && getAccessor().getField(fileSizeField).updateValue(file.size);
      fileTypeField && getAccessor().getField(fileTypeField).updateValue(file.type);
      lastModifiedField && getAccessor().getField(lastModifiedField).updateValue(file.lastModified);
    });
  }
});
exports.getGenericFileMetadataExtractor = getGenericFileMetadataExtractor;
//# sourceMappingURL=getGenericFileMetadataExtractor.cjs.map
