import { jsx } from "react/jsx-runtime";
import { forwardRef, useMemo } from "react";
/* empty css                */
import Chip from "../../node_modules/@mui/material/Chip/Chip.js";
const Chips = forwardRef(
  ({
    label,
    onClick,
    disabled = false,
    type = "default",
    isActive = false,
    className = "",
    ...args
  }, ref) => {
    const containerClass = useMemo(() => {
      let retVal = `impact-chip-container ${type} ${className}`;
      if (isActive) {
        retVal += " selected";
      }
      return retVal.trim();
    }, [type, isActive, className]);
    const handleClick = () => {
      if (!disabled && onClick) {
        onClick(label);
      }
    };
    const getAriaProps = () => {
      if (type === "single") {
        return {
          role: "radio",
          "aria-checked": isActive
        };
      }
      if (type === "multi") {
        return {
          role: "checkbox",
          "aria-checked": isActive
        };
      }
      return {
        role: "button"
      };
    };
    return /* @__PURE__ */ jsx("div", { ref, className: containerClass, children: /* @__PURE__ */ jsx(
      Chip,
      {
        "aria-disabled": disabled,
        "aria-label": label,
        component: "div",
        disabled,
        label,
        onClick: handleClick,
        ...getAriaProps(),
        ...args,
        disableRipple: true
      }
    ) });
  }
);
Chips.displayName = "Chips";
export {
  Chips
};
