import { jsx as c } from "@emotion/react/jsx-runtime";
import { memo as o, useMemo as t } from "react";
import { renderAdornment as u } from "../RenderAdornment/RenderAdornment.js";
import { MenuItem as i } from "../../../MenuItem/MenuItem.js";
const M = o(i), z = ({
  optionProps: d,
  option: e,
  getOptionStartAdornment: r,
  getOptionEndAdornment: n,
  getOptionDescription: l
}) => {
  const { key: m, ...f } = d, a = t(() => {
    if (!r)
      return null;
    const s = r(e);
    return s ? u(s, e.size) : null;
  }, [r, e]), b = t(() => {
    if (!n)
      return null;
    const s = n(e);
    return s ? u(s, e.size) : null;
  }, [n, e]);
  return /* @__PURE__ */ c(
    M,
    {
      ...f,
      selected: e.selected,
      color: "default",
      label: e.label,
      disabled: e.disabled,
      startAdornment: a,
      endAdornment: b,
      description: l ? l(e) : void 0
    }
  );
}, y = o(z), I = (d, e, r, n, l) => {
  const m = d.key || e?.id?.toString() || e.label;
  return /* @__PURE__ */ c(
    y,
    {
      optionProps: d,
      option: e,
      getOptionStartAdornment: r,
      getOptionEndAdornment: n,
      getOptionDescription: l
    },
    m
  );
};
export {
  I as renderOption
};
