function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";
var useSortableHeader = function useSortableHeader(columnId, enabled) {
  var _useSortable = useSortable({
      id: columnId,
      disabled: !enabled
    }),
    attributes = _useSortable.attributes,
    listeners = _useSortable.listeners,
    setNodeRef = _useSortable.setNodeRef,
    transform = _useSortable.transform,
    transition = _useSortable.transition,
    isDragging = _useSortable.isDragging;
  var style = {
    transform: CSS.Transform.toString(transform),
    transition: transition,
    opacity: isDragging ? 0.5 : 1,
    position: "relative",
    zIndex: isDragging ? 1 : undefined
  };
  return {
    sortableRef: setNodeRef,
    sortableStyle: style,
    dragHandleProps: enabled ? _extends({}, attributes, listeners) : {},
    isDragging: isDragging
  };
};
export default useSortableHeader;