import { CLICK_EVENT } from '../../constants/events';

type eventType = 'Clicked' | 'Seleckted' | 'BackClicked'

export const clickedEvent = (keyEvent: eventType, value: string) => new CustomEvent(CLICK_EVENT, {
    detail: { keyEvent, value }
});

export const handleAnalitycEvent = (keyEvent: eventType, value: string) => {
  window.dispatchEvent(clickedEvent(keyEvent, value))
}