import { jsx as e } from "@emotion/react/jsx-runtime";
import { forwardRef as C, useContext as s } from "react";
import { SelectCellFormatter as f } from "react-data-grid";
import { DataGridContext as b } from "../../../contexts/DataGridContext/DataGridContext.js";
import { CheckboxCellWrapperStyled as h } from "../../../slots/DataGridSlot.js";
import { RadioFormatter as k } from "../../TableView/subcomponents/RadioSelectColumn/subcomponents/RadioFormatter/RadioFormatter.js";
import { CheckboxFormatter as x } from "../../TableView/subcomponents/CheckboxFormatter/CheckboxFormatter.js";
const y = C(function(c, i) {
  const {
    value: o,
    disabled: t,
    tabIndex: r,
    onChange: a,
    "aria-label": l
  } = c, n = s(b), m = n?.viewMode ?? "cards", d = n?.checkedRowsMultiple;
  return m !== "table" ? /* @__PURE__ */ e(h, { ownerState: {}, onClick: (p) => {
    p.stopPropagation();
  }, children: /* @__PURE__ */ e(
    d === !1 ? k : x,
    {
      ref: i,
      checked: o,
      disabled: t,
      tabIndex: r,
      onChange: a,
      "aria-label": l
    }
  ) }) : /* @__PURE__ */ e(
    f,
    {
      value: o,
      disabled: t,
      tabIndex: r,
      onChange: a,
      "aria-label": l || "Select"
    }
  );
});
export {
  y as CheckboxCellAdapter
};
