"use client" import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" import { useLazyPathname } from "@scandic-hotels/common/hooks/useLazyPathname" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import Footnote from "@scandic-hotels/design-system/Footnote" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" import { LoginButton } from "@scandic-hotels/design-system/LoginButton" import Link from "@scandic-hotels/design-system/OldDSLink" import { Typography } from "@scandic-hotels/design-system/Typography" import { trackEvent } from "@scandic-hotels/tracking/base" import { trackLoginClick } from "@scandic-hotels/tracking/navigation" import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext" import { useRoomContext } from "../../../../../contexts/EnterDetails/RoomContext" import useLang from "../../../../../hooks/useLang" import styles from "./joinScandicFriendsCard.module.css" type Props = { name?: string } export function JoinScandicFriendsCard({ name = "join" }: Props) { const lang = useLang() const intl = useIntl() const { routes } = useBookingFlowConfig() const loginPathname = useLazyPathname({ includeSearchParams: true }) const { room, actions: { updateJoin }, } = useRoomContext() function onChange(event: { target: { value: boolean } }) { if (event.target.value) { trackEvent({ event: "memberPriceActivated", cta: { name: "join scandic friends now", position: "banner enter details page", }, }) } updateJoin(event.target.value) } if (!("member" in room.roomRate) || !room.roomRate.member) { return null } return (