import { jsxs, Fragment, jsx } from "react/jsx-runtime";
import { SugaredField } from "@contember/react-binding";
const getGenericFileMetadataExtractor = ({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }) => ({
  staticRender: () => /* @__PURE__ */ jsxs(Fragment, { children: [
    !!fileNameField && /* @__PURE__ */ jsx(SugaredField, { field: fileNameField }),
    !!fileSizeField && /* @__PURE__ */ jsx(SugaredField, { field: fileSizeField }),
    !!fileTypeField && /* @__PURE__ */ jsx(SugaredField, { field: fileTypeField }),
    !!lastModifiedField && /* @__PURE__ */ jsx(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);
    });
  }
});
export {
  getGenericFileMetadataExtractor
};
//# sourceMappingURL=getGenericFileMetadataExtractor.js.map
