// (C) 2022-2026 GoodData Corporation
import { useCallback } from "react";
import { moveNestedLayoutSectionItemToNewSectionAndRemoveOriginalSectionIfEmpty } from "../../../../model/commands/layout.js";
import { useDashboardDispatch } from "../../../../model/react/DashboardStoreProvider.js";
export function useMoveWidgetToNewSectionDropHandler(newSectionIndex) {
    const dispatch = useDashboardDispatch();
    return useCallback((item) => {
        dispatch(moveNestedLayoutSectionItemToNewSectionAndRemoveOriginalSectionIfEmpty(item.layoutPath, newSectionIndex));
    }, [dispatch, newSectionIndex]);
}
