import { Typography } from "@scandic-hotels/design-system/Typography"

import Image from "@/components/Image"
import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"

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

import type { PromoProps } from "@/types/components/hotelReservation/bookingConfirmation/promo"

export default function Promo({
  buttonText,
  href,
  text,
  title,
  image,
}: PromoProps) {
  return (
    <Link color="none" href={href}>
      <article className={styles.promo}>
        {image && (
          <div className={styles.imageContainer}>
            <Image
              className={styles.image}
              src={image.imageSizes.large}
              alt={image.metaData.altText}
              fill
            />
          </div>
        )}
        <div className={styles.overlay} />
        <div className={styles.content}>
          <Typography variant="Title/smRegular">
            <p>{title}</p>
          </Typography>
          <Typography variant="Body/Paragraph/mdRegular">
            <p className={styles.text}>{text}</p>
          </Typography>
          <Button asChild intent="secondary" size="small" theme="primaryStrong">
            <span>{buttonText}</span>
          </Button>
        </div>
      </article>
    </Link>
  )
}
