import { jsx as a } from "@emotion/react/jsx-runtime";
import b from "react";
import z from "clsx";
import { ChipStatusFormatterRootStyled as y } from "./slots/ChipStatusFormatterSlots.js";
import { useComponentSize as F } from "../../../hooks/useComponentSize/index.js";
import { CHIP_STATUS_FORMATTER_CLASSES as R } from "./constants.js";
const _ = (r) => {
  const {
    label: e,
    status: o,
    className: s,
    statusesColors: i,
    Component: m = b.Fragment,
    fallbackColor: c = "default",
    fallbackVariant: l = "contained",
    fallbackOpacity: n = !0,
    size: u = "medium",
    dataTestid: p
  } = r, { currentSize: t } = F(u);
  if (!o)
    return null;
  const d = i[o] || {
    color: c,
    variant: l,
    opacity: n
  }, { color: S, variant: f, opacity: C = !0 } = d, T = t === "small" || t === "medium" ? t : "medium";
  return /* @__PURE__ */ a(m, { children: /* @__PURE__ */ a(
    y,
    {
      className: z(s, R.root),
      ownerState: {},
      label: e,
      color: S,
      variant: f,
      opacity: C,
      size: T,
      dataTestId: p
    }
  ) });
};
export {
  _ as ChipStatusFormatter
};
