// (C) 2020-2026 GoodData Corporation
import { useCallback } from "react";
import { userInteractionTriggered, } from "../events/userInteraction.js";
import { useDashboardEventDispatch } from "./useDashboardEventDispatch.js";
/**
 * Hook for dispatching relevant user interaction commands.
 * These commands enable to track user interactions that cannot be tracked by other existing events.
 *
 * @internal
 */
export const useDashboardUserInteraction = () => {
    const eventDispatch = useDashboardEventDispatch();
    const poweredByGDLogoClicked = useCallback(() => {
        eventDispatch(userInteractionTriggered("poweredByGDLogoClicked"));
    }, [eventDispatch]);
    const kpiAlertDialogClosed = useCallback(() => {
        eventDispatch(userInteractionTriggered("kpiAlertDialogClosed"));
    }, [eventDispatch]);
    const kpiAlertDialogOpened = useCallback((alreadyHasAlert) => {
        eventDispatch(userInteractionTriggered({ interaction: "kpiAlertDialogOpened", data: { alreadyHasAlert } }));
    }, [eventDispatch]);
    const descriptionTooltipOpened = useCallback((eventData) => {
        eventDispatch(userInteractionTriggered({ interaction: "descriptionTooltipOpened", data: eventData }));
    }, [eventDispatch]);
    const shareDialogInteraction = useCallback((eventData) => {
        eventDispatch(userInteractionTriggered({ interaction: "shareDialogInteraction", data: eventData }));
    }, [eventDispatch]);
    const attributeFilterInteraction = useCallback((eventType) => {
        eventDispatch(userInteractionTriggered(eventType));
    }, [eventDispatch]);
    const attributeHierarchiesInteraction = useCallback((eventType) => {
        eventDispatch(userInteractionTriggered(eventType));
    }, [eventDispatch]);
    const visualizationSwitcherInteraction = useCallback((eventType) => {
        eventDispatch(userInteractionTriggered(eventType));
    }, [eventDispatch]);
    const nestedLayoutInteraction = useCallback((eventType) => {
        eventDispatch(userInteractionTriggered(eventType));
    }, [eventDispatch]);
    const automationInteraction = useCallback((eventData) => {
        eventDispatch(userInteractionTriggered({ interaction: "automationInteraction", data: eventData }));
    }, [eventDispatch]);
    const filterContextStateReset = useCallback(() => {
        eventDispatch(userInteractionTriggered("filterContextStateReset"));
    }, [eventDispatch]);
    const interactionPanelOpened = useCallback(() => {
        eventDispatch(userInteractionTriggered("interactionPanelOpened"));
    }, [eventDispatch]);
    const addInteractionClicked = useCallback(() => {
        eventDispatch(userInteractionTriggered("addInteractionClicked"));
    }, [eventDispatch]);
    const dateFilterInteraction = useCallback((eventType) => {
        eventDispatch(userInteractionTriggered(eventType));
    }, [eventDispatch]);
    const savedFilterViewInteraction = useCallback((eventData) => {
        eventDispatch(userInteractionTriggered({ interaction: "savedFilterViewInteraction", data: eventData }));
    }, [eventDispatch]);
    return {
        poweredByGDLogoClicked,
        kpiAlertDialogClosed,
        kpiAlertDialogOpened,
        descriptionTooltipOpened,
        shareDialogInteraction,
        attributeFilterInteraction,
        filterContextStateReset,
        interactionPanelOpened,
        addInteractionClicked,
        attributeHierarchiesInteraction,
        dateFilterInteraction,
        visualizationSwitcherInteraction,
        automationInteraction,
        savedFilterViewInteraction,
        nestedLayoutInteraction,
    };
};
//# sourceMappingURL=useDashboardUserInteraction.js.map