import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2020-2026 GoodData Corporation
import { useIntl } from "react-intl";
import { invariant } from "ts-invariant";
import { isInsightWidget } from "@gooddata/sdk-model";
import { useDashboardSelector } from "../../../../../model/react/DashboardStoreProvider.js";
import { selectInsightByRef } from "../../../../../model/store/insights/insightsSelectors.js";
import { selectWidgetByRef } from "../../../../../model/store/tabs/layout/layoutSelectors.js";
import { ParameterDetail } from "./ParameterDetail.js";
export function InsightIdParameterDetail({ title, widgetRef }) {
    const intl = useIntl();
    const widget = useDashboardSelector(selectWidgetByRef(widgetRef));
    invariant(isInsightWidget(widget), "must be insight widget selected");
    const insight = useDashboardSelector(selectInsightByRef(widget.insight));
    return (_jsx(ParameterDetail, { title: title, typeName: intl.formatMessage({
            id: "configurationPanel.drillIntoUrl.editor.identifierTypeLabel",
        }), useEllipsis: false, values: insight?.insight.identifier ? [insight.insight.identifier] : [] }));
}
//# sourceMappingURL=InsightIdParameterDetail.js.map