Files
web/apps/scandic-web/components/HotelReservation/MyStay/Rooms/SingleRoom/Details/Breakfast.tsx
Joakim Jäderberg aafad9781f Merged in feat/lokalise-rebuild (pull request #2993)
Feat/lokalise rebuild

* chore(lokalise): update translation ids

* chore(lokalise): easier to switch between projects

* chore(lokalise): update translation ids

* .

* .

* .

* .

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* .

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* .

* .

* chore(lokalise): update translation ids

* chore(lokalise): update translation ids

* chore(lokalise): new translations

* merge

* switch to errors for missing id's

* merge

* sync translations


Approved-by: Linus Flood
2025-10-22 11:00:03 +00:00

45 lines
1.2 KiB
TypeScript

"use client"
import { useIntl } from "react-intl"
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
import { useMyStayStore } from "@/stores/my-stay"
import Row from "./Row"
export default function Breakfast() {
const intl = useIntl()
const { breakfast, breakfastChildren, rateDefinition } = useMyStayStore(
(state) => ({
breakfast: state.bookedRoom.breakfast,
breakfastChildren: state.bookedRoom.breakfastChildren,
rateDefinition: state.bookedRoom.rateDefinition,
})
)
let breakfastPrice = intl.formatMessage({
id: "common.noBreakfast",
defaultMessage: "No breakfast",
})
if (rateDefinition.breakfastIncluded) {
breakfastPrice = intl.formatMessage({
id: "common.included",
defaultMessage: "Included",
})
} else if (breakfast) {
const childPrice = breakfastChildren?.localPrice.totalPrice || 0
breakfastPrice = formatPrice(
intl,
breakfast.localPrice.totalPrice + childPrice,
breakfast.localPrice.currency
)
}
const title = intl.formatMessage({
id: "common.breakfast",
defaultMessage: "Breakfast",
})
return <Row icon="coffee" text={breakfastPrice} title={title} />
}