import { SugaredField } from "@contember/binding";
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileDataExtractors/getGenericFileMetadataExtractor.tsx";
const getGenericFileMetadataExtractor = ({
  fileNameField,
  fileSizeField,
  fileTypeField,
  lastModifiedField
}) => ({
  staticRender: () => /* @__PURE__ */ jsxDEV(Fragment, {
    children: [!!fileNameField && /* @__PURE__ */ jsxDEV(SugaredField, {
      field: fileNameField
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 17,
      columnNumber: 24
    }, void 0), !!fileSizeField && /* @__PURE__ */ jsxDEV(SugaredField, {
      field: fileSizeField
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 18,
      columnNumber: 24
    }, void 0), !!fileTypeField && /* @__PURE__ */ jsxDEV(SugaredField, {
      field: fileTypeField
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 19,
      columnNumber: 24
    }, void 0), !!lastModifiedField && /* @__PURE__ */ jsxDEV(SugaredField, {
      field: lastModifiedField
    }, void 0, false, {
      fileName: _jsxFileName,
      lineNumber: 20,
      columnNumber: 28
    }, void 0)]
  }, void 0, true),
  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);
    });
  }
});
export {
  getGenericFileMetadataExtractor
};
//# sourceMappingURL=getGenericFileMetadataExtractor.js.map
