"use client"
import { Button } from "@scandic-hotels/design-system/Button"

import { requestOpen } from "@/utils/profilingConsent"
import { trackConsentAction } from "@/utils/tracking/profilingConsent"

interface BannerButtonProps {
  cta: string
}

export function BannerButton({ cta }: BannerButtonProps) {
  function handleOpenModal() {
    trackConsentAction({ position: "banner", name: cta })
    requestOpen()
  }

  return (
    <Button
      variant="Secondary"
      color="Primary"
      size="sm"
      onPress={handleOpenModal}
    >
      {cta}
    </Button>
  )
}
