Merged in feat/BOOK-479-scandic-go-hotels-rm-brf- (pull request #3143)

feat(BOOK-479): Updated breakfast UI for ScandicGo hotels

Approved-by: Erik Tiekstra
This commit is contained in:
Hrishikesh Vaipurkar
2025-11-18 13:03:46 +00:00
parent 93c481fea8
commit 4c0daf8062
23 changed files with 144 additions and 213 deletions

View File

@@ -0,0 +1,72 @@
"use client"
import { useIntl } from "react-intl"
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import { Typography } from "@scandic-hotels/design-system/Typography"
import styles from "./summaryBreakfast.module.css"
interface BreakfastProps {
breakfastPrice: number | false | undefined
breakfastCurrency?: string | null
breakfastIncluded: boolean
guests: string
hotelOffersBreakfast: boolean
}
export function SummaryBreakfast({
breakfastPrice,
breakfastCurrency,
breakfastIncluded,
guests,
hotelOffersBreakfast = true,
}: BreakfastProps) {
const intl = useIntl()
const breakfastBuffet = intl.formatMessage({
id: "common.breakfastBuffet",
defaultMessage: "Breakfast buffet",
})
if (breakfastIncluded || (breakfastPrice && breakfastCurrency)) {
const price =
breakfastPrice && breakfastCurrency
? formatPrice(intl, breakfastPrice, breakfastCurrency)
: intl.formatMessage({
id: "common.included",
defaultMessage: "Included",
})
return (
<div className={styles.entry}>
<div>
<Typography variant="Body/Paragraph/mdRegular">
<p className={styles.textDefault}>{breakfastBuffet}</p>
</Typography>
<Typography variant="Body/Supporting text (caption)/smRegular">
<p className={styles.textSecondary}>{guests}</p>
</Typography>
</div>
<Typography variant="Body/Paragraph/mdRegular">
<p className={styles.textDefault}>{price}</p>
</Typography>
</div>
)
}
if (breakfastPrice === false) {
const noBreakfast = intl.formatMessage({
id: "common.noBreakfast",
defaultMessage: "No breakfast",
})
return (
<Typography variant="Body/Paragraph/mdRegular">
<div className={`${styles.entry} ${styles.textDefault}`}>
{hotelOffersBreakfast ? <p>{breakfastBuffet}</p> : null}
<p>{noBreakfast}</p>
</div>
</Typography>
)
}
return null
}