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