import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2026 GoodData Corporation
import { useMemo } from "react";
import { areObjRefsEqual, objRefToString } from "@gooddata/sdk-model";
import { IconDragHandle, ShortenedText } from "@gooddata/sdk-ui-kit";
import { useTheme } from "@gooddata/sdk-ui-theme-provider";
import { useDashboardSelector } from "../../../model/react/DashboardStoreProvider.js";
import { selectCatalogMeasures } from "../../../model/store/catalog/catalogSelectors.js";
export function DefaultMeasureValueFilterDraggingComponent({ item, }) {
    const theme = useTheme();
    const measures = useDashboardSelector(selectCatalogMeasures);
    const { measure, title } = item.filter.dashboardMeasureValueFilter;
    const catalogMeasure = useMemo(() => measures.find((m) => areObjRefsEqual(m.measure.ref, measure)), [measure, measures]);
    const measureTitle = title ?? catalogMeasure?.measure.title ?? objRefToString(measure);
    return (_jsxs("div", { className: "measure-value-filter-button attribute-filter-button is-dragging", children: [
            _jsx(IconDragHandle, { width: 7, height: 26, className: "drag-handle-icon", color: theme?.palette?.complementary?.c5 }), _jsx("div", { className: "button-content", children: _jsx("div", { className: "button-title", children: _jsx(ShortenedText, { children: measureTitle }) }) })
        ] }));
}
