feat: add no breakfast message to price details modal and to conf page receipt

This commit is contained in:
Simon Emanuelsson
2025-05-09 11:56:50 +02:00
parent 3cd8c59dd3
commit ca29237f2e
14 changed files with 389 additions and 279 deletions

View File

@@ -0,0 +1,12 @@
.entry {
display: flex;
justify-content: space-between;
}
.textDefault {
color: var(--Text-Default);
}
.textSecondary {
color: var(--Text-Secondary);
}

View File

@@ -0,0 +1,65 @@
"use client"
import { useIntl } from "react-intl"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { formatPrice } from "@/utils/numberFormatting"
import styles from "./breakfast.module.css"
import type { PackageSchema } from "@/types/trpc/routers/booking/confirmation"
interface BreakfastProps {
breakfast: PackageSchema | false | undefined
breakfastIncluded: boolean
guests: string
}
export default function Breakfast({
breakfast,
breakfastIncluded,
guests,
}: BreakfastProps) {
const intl = useIntl()
const breakfastBuffet = intl.formatMessage({
defaultMessage: "Breakfast buffet",
})
if (breakfastIncluded || breakfast) {
const price = breakfast
? formatPrice(intl, breakfast.totalPrice, breakfast.currency)
: intl.formatMessage({ 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 (breakfast === false) {
const noBreakfast = intl.formatMessage({ defaultMessage: "No breakfast" })
return (
<div className={styles.entry}>
<Typography variant="Body/Paragraph/mdRegular">
<p className={styles.textDefault}>{breakfastBuffet}</p>
</Typography>
<Typography variant="Body/Paragraph/mdRegular">
<p className={styles.textDefault}>{noBreakfast}</p>
</Typography>
</div>
)
}
return null
}