import { jsx as e } from "react/jsx-runtime";
import { useState as b, useCallback as p } from "react";
import { useSensors as C, useSensor as n, PointerSensor as x, KeyboardSensor as D, DndContext as f, closestCenter as h } from "@dnd-kit/core";
import { sortableKeyboardCoordinates as u, SortableContext as v, verticalListSortingStrategy as y } from "@dnd-kit/sortable";
import { restrictToVerticalAxis as A } from "@dnd-kit/modifiers";
import E from "./TableSettingsListItem.js";
const j = (i) => {
  const { items: o, itemProps: a, onSortEnd: l } = i, [r, s] = b(null), m = C(
    n(x),
    n(D, { coordinateGetter: u })
  ), c = p((t) => {
    s(t.active.id);
  }, []), d = (t) => {
    s(null), l(t, o);
  }, g = "table-settings-item shadow-smooth-to-bottom z-index-max";
  return /* @__PURE__ */ e("ol", { className: "table-settings-items-container padding-0 margin-0", children: /* @__PURE__ */ e(
    f,
    {
      sensors: m,
      collisionDetection: h,
      modifiers: [A],
      onDragStart: c,
      onDragEnd: d,
      children: /* @__PURE__ */ e(v, { items: o, strategy: y, children: o.map((t, S) => /* @__PURE__ */ e(
        E,
        {
          column: t,
          orderIndex: S,
          isActive: r === t,
          className: r === t ? g : "",
          ...a
        },
        t
      )) })
    }
  ) });
};
export {
  j as TableSettingsListContainer
};
//# sourceMappingURL=TableSettingsListContainer.js.map
