"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-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__ */ jsxDevRuntime.jsxDEV(
    ui.FilePreview,
    {
      overlay: endUserMessages.length ? /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.ErrorList, { errors: endUserMessages }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/ErrorFilePreview.tsx",
        lineNumber: 22,
        columnNumber: 6
      }, this) : /* @__PURE__ */ jsxDevRuntime.jsxDEV(ui.Message, { intent: "danger", children: formatMessage("upload.fileState.invalidFile") }, void 0, false, {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/ErrorFilePreview.tsx",
        lineNumber: 24,
        columnNumber: 6
      }, this)
    },
    void 0,
    false,
    {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/internalComponents/SingleFilePreview/ErrorFilePreview.tsx",
      lineNumber: 19,
      columnNumber: 3
    },
    this
  );
}
exports.ErrorFilePreview = ErrorFilePreview;
//# sourceMappingURL=ErrorFilePreview.cjs.map
