/**
 * 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::ac0d75fa9e8d43c947e88f47ba1267aa>>
 * @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 var useAnalyticsEvents = function useAnalyticsEvents() {
  var _useAnalyticsNextEven = useAnalyticsNextEvents(),
    createAnalyticsEvent = _useAnalyticsNextEven.createAnalyticsEvent;
  var fireEvent = useCallback(function () {
    var event = createAnalyticsEvent(createEventPayload.apply(void 0, arguments));
    event.fire(EVENT_CHANNEL);
  }, [createAnalyticsEvent]);
  return {
    fireEvent: fireEvent
  };
};