import { createElement } from "react";
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__ */ createElement(FilePreview, {
    overlay: endUserMessages.length ? /* @__PURE__ */ createElement(ErrorList, {
      errors: endUserMessages
    }) : /* @__PURE__ */ createElement(Message, {
      intent: "danger"
    }, formatMessage("upload.fileState.invalidFile"))
  });
}
export { ErrorFilePreview };
//# sourceMappingURL=ErrorFilePreview.js.map
