import { jsxDEV } from "react/jsx-dev-runtime";
import { FilePreview, ErrorList, Message } from "@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__ */ jsxDEV(
    FilePreview,
    {
      overlay: endUserMessages.length ? /* @__PURE__ */ jsxDEV(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__ */ jsxDEV(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
  );
}
export {
  ErrorFilePreview
};
//# sourceMappingURL=ErrorFilePreview.js.map
