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