import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2022-2025 GoodData Corporation
import { useCallback, useMemo } from "react";
import { NonContextToastsInterop } from "@gooddata/sdk-ui-kit";
import { useCrossFilteringMessages } from "./useCrossFilteringMessages.js";
import { useDrillValidationMessages } from "./useDrillValidationMessages.js";
import { useFilterContextValidationMessages } from "./useFilterContextValidationMessages.js";
/**
 * @internal
 */
export function ToastMessages() {
    const { messages: drillValidationMessages, removeMessage: removeDrillValidationMessage } = useDrillValidationMessages();
    const { messages: filterContextValidationMessages, removeMessage: removeFilterContextValidationMessage } = useFilterContextValidationMessages();
    useCrossFilteringMessages();
    const messages = useMemo(() => [...drillValidationMessages, ...filterContextValidationMessages], [drillValidationMessages, filterContextValidationMessages]);
    const removeMessage = useCallback(
    // try removing the id from both collections
    (id) => {
        removeDrillValidationMessage(id);
        removeFilterContextValidationMessage(id);
    }, [removeDrillValidationMessage, removeFilterContextValidationMessage]);
    return _jsx(NonContextToastsInterop, { messages: messages, onDismissMessage: removeMessage });
}
//# sourceMappingURL=ToastMessages.js.map