import type { Event } from "./types";

// biome-ignore lint/suspicious/noExplicitAny: <explanation>
type EventParams<T = any> = {
	[key: string]: T;
};

export function logEvent(action: Event, params?: EventParams) {
	if (typeof window === "undefined") return;
	if (window.gtag) {
		window.gtag("event", action, params || {});
	}
}
