import {
    KeyboardSensor,
    PointerSensor,
    TouchSensor,
    useSensor,
    useSensors,
} from "@dnd-kit/core";
import { sortableKeyboardCoordinates } from "@dnd-kit/sortable";

const useDndSensors = () => {
    const sensorOptions = {
        activationConstraint: {
            distance: 5,
        },
    };

    return useSensors(
        useSensor(PointerSensor, sensorOptions),
        useSensor(KeyboardSensor, {
            coordinateGetter: sortableKeyboardCoordinates,
        }),
        useSensor(TouchSensor, sensorOptions)
    );
};

export default useDndSensors;
