Files
web/components/HotelReservation/SignupPromo/Desktop.tsx
Tobias Johansson a7468cd958 Merged in feat/SW-1379-multiroom-summary (pull request #1198)
Feat/SW-1379 multiroom summary

* fix: added early return in hotel query and added missing type annotations

* feat(SW-1379): update summary to support multiple rooms and add tests

* fix: added check for room number when using isMember for member prices

* fix: remove mocked array

* fix: minor bug fixes in rate details popup

* fix: translation key


Approved-by: Pontus Dreij
Approved-by: Arvid Norlin
2025-01-29 09:25:43 +00:00

48 lines
1.3 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
import Caption from "@/components/TempDesignSystem/Text/Caption"
import Footnote from "@/components/TempDesignSystem/Text/Footnote"
import { formatPrice } from "@/utils/numberFormatting"
import styles from "./signupPromo.module.css"
import type { SignupPromoProps } from "@/types/components/hotelReservation/signupPromo"
export default function SignupPromoDesktop({
memberPrice,
badgeContent,
}: SignupPromoProps) {
const intl = useIntl()
if (!memberPrice) {
return null
}
const { amount, currency } = memberPrice
const price = formatPrice(intl, amount, currency)
return memberPrice ? (
<div
className={styles.memberDiscountBannerDesktop}
data-testid="signup-promo-desktop"
>
{badgeContent && <span className={styles.badge}>{badgeContent}</span>}
<Footnote color="burgundy">
{intl.formatMessage<React.ReactNode>(
{
id: "To get the member price <span>{price}</span>, log in or join when completing the booking.",
},
{
span: (str) => (
<Caption color="red" type="bold" asChild>
<span>{str}</span>
</Caption>
),
price,
}
)}
</Footnote>
</div>
) : null
}