// (C) 2021-2026 GoodData Corporation
import { useCallback } from "react";
import { defineMessages } from "react-intl";
import { useEventToastMessage } from "../../../_staging/sharedHooks/useEventToastMessage.js";
import { isDashboardCrossFilteringResolved, } from "../../../model/events/drill.js";
const crossFilterMessages = defineMessages({
    crossFilterSuccess: {
        id: "dashboard.crossFilter.success",
    },
});
export function useCrossFilteringMessages() {
    const getCrossFilterMessageParameters = useCallback((event) => ({
        values: { count: event.payload.filters.length },
    }), []);
    // Listen for cross-filtering success events and show toast
    useEventToastMessage("success", isDashboardCrossFilteringResolved, crossFilterMessages["crossFilterSuccess"], getCrossFilterMessageParameters);
}
