import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2024-2026 GoodData Corporation
import { DASHBOARD_LAYOUT_WIDGET_SIZE_INFO_DEFAULT } from "@gooddata/sdk-ui-ext";
import { useWidgetSelection } from "../../../model/react/useWidgetSelection.js";
import { DraggableCreatePanelItem } from "../DraggableCreatePanelItem.js";
const getDragItem = () => {
    return {
        type: "dashboardLayoutListItem",
        size: {
            gridHeight: DASHBOARD_LAYOUT_WIDGET_SIZE_INFO_DEFAULT.height.default,
            gridWidth: DASHBOARD_LAYOUT_WIDGET_SIZE_INFO_DEFAULT.width.default,
        },
    };
};
/**
 * @internal
 */
export function DraggableDashboardLayoutCreatePanelItem({ CreatePanelItemComponent, WrapCreatePanelItemWithDragComponent, }) {
    const dragItem = getDragItem();
    const { deselectWidgets } = useWidgetSelection();
    return (_jsx(DraggableCreatePanelItem, { Component: CreatePanelItemComponent, WrapCreatePanelItemWithDragComponent: WrapCreatePanelItemWithDragComponent, dragItem: dragItem, hideDefaultPreview: false, onDragStart: () => deselectWidgets() }));
}
//# sourceMappingURL=DraggableDashboardLayoutCreatePanelItem.js.map