"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Sortable;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const react_sortablejs_1 = require("react-sortablejs");
const SortableStyle_1 = require("./SortableStyle");
function Sortable({ list, group, enableBorder = false, renderItem, setList, className, }) {
    return (react_1.default.createElement("div", { className: enableBorder ? 'shadow-xs rounded-lg bg-white border border-gray-200' : '' },
        react_1.default.createElement(SortableStyle_1.SortableStyle, null),
        react_1.default.createElement(react_sortablejs_1.ReactSortable, { list: list, setList: (val) => {
                setList(val);
            }, group: group, animation: 150, fallbackOnBody: true, handle: '.drag-item', swapThreshold: 0.65, chosenClass: 'phx-item-chosen', ghostClass: 'phx-item-ghost', dragClass: 'phx-item-drag', className: `${className} flex flex-col gap-2` }, list.map((item, index) => (react_1.default.createElement("div", { key: item.id }, renderItem(item, index)))))));
}
//# sourceMappingURL=Sortable.js.map