import classnames from "classnames";
import React from "react";
import { MediaUploadErrorKey } from "./../../ricos-content/index.js";
import { Tooltip } from "./../../wix-rich-content-common/lib/tooltip.js";
import { ErrorIcon } from "../Icons/index.js";
import styles from "../statics/styles/media-item-error-msg-scss.js";
const errorMessages = {
  [MediaUploadErrorKey.GENERIC]: "UploadFile_Error_Generic_Item",
  [MediaUploadErrorKey.QUOTA_STORAGE_VISITOR]: "UploadFile_Error_Generic_Item",
  [MediaUploadErrorKey.QUOTA_STORAGE_OWNER]: "UploadFile_Error_Generic_Item",
  [MediaUploadErrorKey.QUOTA_VIDEO_VISITOR]: "UploadFile_Error_Generic_Item",
  [MediaUploadErrorKey.QUOTA_VIDEO_OWNER]: "UploadFile_Error_Generic_Item",
  [MediaUploadErrorKey.SIZE_LIMIT]: "UploadFile_Error_Size_Item"
};
const MediaItemErrorMsg = (props) => {
  const { error, t, isTooltip } = props;
  const errorMsg = error.key && t?.(errorMessages[error.key]) || error.msg || t?.("UploadFile_Error_Generic_Item");
  const errorIconStyles = classnames(styles.errorIcon, !isTooltip && styles.errorIconWithMessage);
  return /* @__PURE__ */ React.createElement("div", { className: styles.error }, isTooltip ? /* @__PURE__ */ React.createElement(Tooltip, { content: errorMsg, isError: true }, /* @__PURE__ */ React.createElement(ErrorIcon, { className: errorIconStyles })) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ErrorIcon, { className: errorIconStyles }), /* @__PURE__ */ React.createElement("div", { className: styles.errorMsg }, errorMsg)));
};
export {
  MediaItemErrorMsg
};
//# sourceMappingURL=media-item-error-msg.js.map
