import { SortableElement } from "react-sortable-hoc";
import * as React from "react";
const defaultClickHandler = () => { };
const SortableItem = SortableElement(({ onClick, className, children, onKeydown }) => (React.createElement("div", { onClick: onClick, className: className, tabIndex: 0, role: "button", onKeyDown: (e) => {
        if (["Enter", "Space"].includes(e.key)) {
            onClick();
        }
        if (onKeydown) {
            onKeydown(e);
        }
    } }, children)));
/**
 * A FinsembleDraggable is a helper that makes its children draggable
 */
export const FinsembleDraggable = (props) => {
    var _a, _b;
    const draggableId = (_a = props.draggableId) !== null && _a !== void 0 ? _a : `Id-Unset-${Math.random() * 23214}`;
    const onClick = (_b = props.onClick) !== null && _b !== void 0 ? _b : defaultClickHandler;
    const className = props.wrapperClass;
    return (React.createElement(SortableItem, { key: draggableId, index: props.index, onClick: onClick, className: className, onKeydown: props.onKeydown }, props.children));
};
//# sourceMappingURL=FinsembleDraggable.js.map