"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDraggingCrosswalk = void 0;
var react_1 = require("react");
var useDraggingCrosswalk = function () {
    var _a = (0, react_1.useState)(null), draggingCrosswalk = _a[0], setDraggingCrosswalk = _a[1];
    var onDragStart = (0, react_1.useCallback)(function (event) {
        var _a, _b;
        var draggingData = (_b = (_a = event === null || event === void 0 ? void 0 : event.active) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.current;
        if ((draggingData === null || draggingData === void 0 ? void 0 : draggingData.type) === 'Crosswalk') {
            setDraggingCrosswalk(draggingData.crosswalk);
        }
    }, []);
    var onDragEnd = (0, react_1.useCallback)(function () {
        setDraggingCrosswalk(null);
    }, []);
    return { draggingCrosswalk: draggingCrosswalk, onDragStart: onDragStart, onDragEnd: onDragEnd };
};
exports.useDraggingCrosswalk = useDraggingCrosswalk;
