import { jsx as i } from "@emotion/react/jsx-runtime";
import { isValidElement as c } from "react";
import { Icon as u } from "@m4l/base";
import { getIconColor as s } from "../../../../../utils/getIconColor.js";
import { OptionStartAdornmentImageStyled as m } from "../../slots/styled.js";
function f(r) {
  return r == null ? null : typeof r == "string" ? "image" : c(r) ? "icon" : "node";
}
function v({
  adornment: r,
  size: n
}) {
  const e = f(r);
  if (e === null)
    return null;
  switch (e) {
    case "image":
      return /* @__PURE__ */ i(
        m,
        {
          src: r,
          width: 24,
          height: 24,
          cover: !0,
          enableIntersectionObserver: !1
        }
      );
    case "icon": {
      const o = r, t = o.props?.color, l = t != null ? s(String(t)) : "text.primary";
      return /* @__PURE__ */ i(
        u,
        {
          src: o,
          size: n ?? "medium",
          color: l
        }
      );
    }
    default:
      return r;
  }
}
export {
  v as RenderOptionStartAdornment
};
