import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2026 GoodData Corporation
import { ParameterControlButton } from "@gooddata/sdk-ui-kit";
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
import { selectCatalogParameterByRef } from "../../../model/store/catalog/catalogSelectors.js";
import { selectDashboardParameterEntryByRef } from "../../../model/store/tabs/parameters/parametersSelectors.js";
/**
 * Renders the floating preview of a parameter chip while it is being dragged.
 *
 * @internal
 */
export function DefaultParameterDraggingComponent({ item }) {
    const entry = useDashboardSelector(selectDashboardParameterEntryByRef(item.ref));
    const workspaceParameter = useDashboardSelector(selectCatalogParameterByRef(item.ref));
    if (entry?.runtimeOverride === undefined) {
        return null;
    }
    const name = entry.parameter.label ?? workspaceParameter?.title ?? "";
    return (_jsx(ParameterControlButton, { name: name, value: entry.runtimeOverride, isActive: false, isDraggable: true, isDragging: true }));
}
