import { _ } from "@/lib/translation"

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

import Contact from "./Contact"

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

import type { JoinLoyaltyContactProps } from "@/types/components/loyalty/sidebar"

export default function JoinLoyaltyContact({ block }: JoinLoyaltyContactProps) {
  return (
    <div className={styles.container}>
      <div className={styles.wrapper}>
        <Title level="h3">{block.title}</Title>
        <Image
          alt="Scandic Friends"
          className={styles.image}
          height={65}
          src="/_static/icons/scandic-friends.png"
          width={203}
        />
        {block.preamble && <p className={styles.preamble}>{block.preamble}</p>}
        <Button intent="primary">
          <span>{_("Join Scandic Friends")}</span>
        </Button>
        <div className={styles.linkContainer}>
          <Link href="/login" className={styles.loginLink}>
            {_("Already a friend?")} <br />
            {_("Click here to log in")}
          </Link>
        </div>
      </div>
      {block.contact && <Contact contactBlock={block.contact} />}
    </div>
  )
}
