import { jsx as n } from "@emotion/react/jsx-runtime";
import t from "react";
import { Icon as c } from "@m4l/base";
import { Image as m } from "../../../../../Image/Image.js";
const u = (o, r) => {
  const { resource: e, type: i } = o;
  if (!e)
    return null;
  if (t.isValidElement(e))
    try {
      return t.cloneElement(e, {
        size: r
      });
    } catch (l) {
      return console.warn("Error cloning React element:", l), null;
    }
  return typeof e == "string" ? i === "image" ? /* @__PURE__ */ n(
    m,
    {
      src: e,
      width: 14,
      height: 14,
      enableIntersectionObserver: !1
    }
  ) : /* @__PURE__ */ n(
    c,
    {
      src: e,
      size: r
    }
  ) : (console.warn("Invalid icon type provided to renderAdornment:", typeof e), null);
};
export {
  u as renderAdornment
};
