"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _sortable = require("@dnd-kit/sortable");
var _utilities = require("@dnd-kit/utilities");
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); }
var useSortableHeader = function useSortableHeader(columnId, enabled) {
  var _useSortable = (0, _sortable.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: _utilities.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
  };
};
var _default = exports["default"] = useSortableHeader;