import { useIntl } from "react-intl" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import { Divider } from "@scandic-hotels/design-system/Divider" import Image from "@scandic-hotels/design-system/Image" import { Typography } from "@scandic-hotels/design-system/Typography" import { AncillaryStepEnum, useAddAncillaryStore, } from "@/stores/my-stay/add-ancillary-flow" import styles from "./description.module.css" export default function Description() { const intl = useIntl() const { selectedAncillary, isBreakfast, currentStep } = useAddAncillaryStore( (state) => ({ selectedAncillary: state.selectedAncillary, isBreakfast: state.isBreakfast, currentStep: state.currentStep, }) ) if (!selectedAncillary || currentStep === AncillaryStepEnum.confirmation) { return null } return (
{formatPrice( intl, selectedAncillary.price.total, selectedAncillary.price.currency )}
{intl.formatMessage( { id: "common.orNumberOfPoints", defaultMessage: "or {points, plural, one {# point} other {# points}}", }, { points: selectedAncillary.points, } )}
{intl.formatMessage( { id: "addAncillaryFlowModal.perUnit", defaultMessage: "/per {unit}", }, { unit: selectedAncillary.unitName } )}