import { trackEvent } from "./base"

import type { TrackingPosition } from "@/types/components/tracking"

export function trackFooterClick(group: string, name: string) {
  trackEvent({
    event: "footer link",
    footer: {
      footerLinkClicked: `${group}:${name}`,
    },
  })
}

export function trackSocialMediaClick(socialMediaName: string) {
  trackEvent({
    event: "social media",
    social: {
      socialIconClicked: socialMediaName,
    },
  })
}

export function trackLoginClick(position: TrackingPosition) {
  trackEvent({
    event: "loginStart",
    login: {
      position,
      action: "login start",
      ctaName: "login",
    },
  })
}

export function trackLanguageSwitchClick(fromLang: string, toLang: string) {
  trackEvent({
    event: "languageSelection",
    language: {
      fromSelection: fromLang,
      toSelection: toLang,
    },
  })
}
