"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const ui = require("@contember/ui");
function ErrorFilePreview({ uploadState, formatMessage }) {
  const endUserMessages = uploadState.errors ? uploadState.errors.filter((error) => !!error.options.endUserMessage).map((error) => ({ message: formatMessage(error.options.endUserMessage, "upload.fileState.invalidFile") })) : [];
  return /* @__PURE__ */ jsxRuntime.jsx(
    ui.FilePreview,
    {
      overlay: endUserMessages.length ? /* @__PURE__ */ jsxRuntime.jsx(ui.ErrorList, { errors: endUserMessages }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Message, { intent: "danger", children: formatMessage("upload.fileState.invalidFile") })
    }
  );
}
exports.ErrorFilePreview = ErrorFilePreview;
//# sourceMappingURL=ErrorFilePreview.cjs.map
