/**
 * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
 *
 * Generates Typescript types for analytics events from analytics.spec.yaml
 *
 * @codegen <<SignedSource::676f76a2e45920437adc8c35a9af8b37>>
 * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
 */
import { useCallback } from 'react';
import { useAnalyticsEvents as useAnalyticsNextEvents } from '@atlaskit/analytics-next';
import { EVENT_CHANNEL } from '../constants';
import createEventPayload from './create-event-payload';
export const useAnalyticsEvents = () => {
  const {
    createAnalyticsEvent
  } = useAnalyticsNextEvents();
  const fireEvent = useCallback((...params) => {
    const event = createAnalyticsEvent(createEventPayload(...params));
    event.fire(EVENT_CHANNEL);
  }, [createAnalyticsEvent]);
  return {
    fireEvent
  };
};