"use client"

import { useIntl } from "react-intl"

import { myStay } from "@/constants/routes/myStay"

import useLang from "@/hooks/useLang"

import Promo from "./Promo"

import styles from "./promos.module.css"

import type { PromosProps } from "@/types/components/hotelReservation/bookingConfirmation/promos"

export default function Promos({ refId, hotelId }: PromosProps) {
  const intl = useIntl()
  const lang = useLang()

  return (
    <div className={styles.promos}>
      <Promo
        buttonText={intl.formatMessage({
          defaultMessage: "View and buy add-ons",
        })}
        href={`${myStay[lang]}?RefId=${refId}`}
        text={intl.formatMessage({
          defaultMessage:
            "Discover the little extra touches to make your upcoming stay even more unforgettable.",
        })}
        title={intl.formatMessage({
          defaultMessage: "Spice things up",
        })}
      />
      <Promo
        buttonText={intl.formatMessage({
          defaultMessage: "Book another stay",
        })}
        href={`/${lang}?hotel=${hotelId}`}
        text={intl.formatMessage({
          defaultMessage:
            "Get inspired and start dreaming beyond your next trip. Explore more Scandic destinations.",
        })}
        title={intl.formatMessage({
          defaultMessage: "Book your next stay",
        })}
      />
    </div>
  )
}
